mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Only fall back to writing to the dest file directly in the case of a permission denied when running as root, as root should already have access to all files
This commit is contained in:
@@ -10674,7 +10674,7 @@ else {
|
||||
my $directopen = 0;
|
||||
my $tmp = &open_tempfile($file);
|
||||
my $ex = open($fh, ">$tmp");
|
||||
if (!$ex && $! =~ /permission/i) {
|
||||
if (!$ex && $! =~ /permission/i && $< != 0) {
|
||||
# Could not open temp file .. try opening actual file
|
||||
# instead directly
|
||||
$ex = open($fh, ">$file");
|
||||
|
||||
Reference in New Issue
Block a user