From c918e6583b2da5f420182dba145571a34dff907f Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 2 Mar 2025 11:12:38 -0800 Subject: [PATCH] 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 --- web-lib-funcs.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 11f7bfc72..0364dee36 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -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");