Revert "Fix to use universal upload tracking directory"
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled

This reverts commit e8e804ddca.
This commit is contained in:
Jamie Cameron
2026-01-25 21:17:14 -08:00
parent 2d0063129c
commit 534c529705
2 changed files with 20 additions and 3 deletions

View File

@@ -28,7 +28,13 @@ print "</table></center>\n";
print "</form>\n";
# 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
# with no progress

View File

@@ -1063,8 +1063,19 @@ my ($size, $totalsize, $filename, $id) = @_;
return if ($gconfig{'no_upload_tracker'});
return if (!$id);
# Universal upload tracking directory
my $vardir = &tempname_dir_sys();
# Create the upload tracking directory - if running as non-root, this has to
# 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
if (!$main::read_parse_mime_callback_flushed) {