aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2014-06-07 20:36:56 +0000
committerpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2014-06-07 20:36:56 +0000
commitc5c13ffec665ad4e88affe1a64453c7eb9c8ecbb (patch)
tree8bfb496835be672b7e16d217d4ddc43a1aca490d
parent36bfde33befc101ad4d10c230b5c44244cb2b3a4 (diff)
downloadpmwiki.svn-c5c13ffec665ad4e88affe1a64453c7eb9c8ecbb.tar.bz2
fixperms() should not make files world readable if file owner is root (PITS:01346)
git-svn-id: svn://pmwiki.org/pmwiki/trunk@2974 524c5546-5005-0410-9a3e-e25e191bd360
-rw-r--r--pmwiki.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/pmwiki.php b/pmwiki.php
index f297601a..e7d98c3b 100644
--- a/pmwiki.php
+++ b/pmwiki.php
@@ -615,7 +615,8 @@ function fixperms($fname, $add = 0, $set = 0) {
}
else {
$bp = 0;
- if (fileowner($fname)!=@fileowner('.')) $bp = (is_dir($fname)) ? 007 : 006;
+ if (fileowner($fname)!=@fileowner('.') && @fileowner('.')!==0)
+ $bp = (is_dir($fname)) ? 007 : 006;
if (filegroup($fname)==@filegroup('.')) $bp <<= 3;
$bp |= $add;
if ($bp && (fileperms($fname) & $bp) != $bp)