mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Revert "Fix to use universal upload tracking directory"
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
This reverts commit e8e804ddca.
This commit is contained in:
@@ -28,7 +28,13 @@ print "</table></center>\n";
|
|||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
# Find the location of the user's upload progress file
|
# Find the location of the user's upload progress file
|
||||||
my $upfile = &tempname_dir_sys()."/upload.$id";
|
if ($in{'uid'}) {
|
||||||
|
@uinfo = getpwuid($in{'uid'});
|
||||||
|
$upfile = "$uinfo[7]/.tmp/upload.$id";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$upfile = &tempname_dir()."/upload.$id";
|
||||||
|
}
|
||||||
|
|
||||||
# Read the tracker file in a loop until done, or until 1 minute has passed
|
# Read the tracker file in a loop until done, or until 1 minute has passed
|
||||||
# with no progress
|
# with no progress
|
||||||
|
|||||||
@@ -1063,8 +1063,19 @@ my ($size, $totalsize, $filename, $id) = @_;
|
|||||||
return if ($gconfig{'no_upload_tracker'});
|
return if ($gconfig{'no_upload_tracker'});
|
||||||
return if (!$id);
|
return if (!$id);
|
||||||
|
|
||||||
# Universal upload tracking directory
|
# Create the upload tracking directory - if running as non-root, this has to
|
||||||
my $vardir = &tempname_dir_sys();
|
# be under the user's home
|
||||||
|
my $vardir;
|
||||||
|
if ($<) {
|
||||||
|
my @uinfo = @remote_user_info ? @remote_user_info : getpwuid($<);
|
||||||
|
$vardir = "$uinfo[7]/.tmp";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$vardir = &tempname_dir();
|
||||||
|
}
|
||||||
|
if (!-d $vardir) {
|
||||||
|
&make_dir($vardir, 0755);
|
||||||
|
}
|
||||||
|
|
||||||
# Remove any upload.* files more than 1 hour old
|
# Remove any upload.* files more than 1 hour old
|
||||||
if (!$main::read_parse_mime_callback_flushed) {
|
if (!$main::read_parse_mime_callback_flushed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user