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:
parent
37f4fce674
commit
c918e6583b
@ -10674,7 +10674,7 @@ else {
|
|||||||
my $directopen = 0;
|
my $directopen = 0;
|
||||||
my $tmp = &open_tempfile($file);
|
my $tmp = &open_tempfile($file);
|
||||||
my $ex = open($fh, ">$tmp");
|
my $ex = open($fh, ">$tmp");
|
||||||
if (!$ex && $! =~ /permission/i) {
|
if (!$ex && $! =~ /permission/i && $< != 0) {
|
||||||
# Could not open temp file .. try opening actual file
|
# Could not open temp file .. try opening actual file
|
||||||
# instead directly
|
# instead directly
|
||||||
$ex = open($fh, ">$file");
|
$ex = open($fh, ">$file");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user