diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2014-06-07 20:36:56 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2014-06-07 20:36:56 +0000 |
commit | c5c13ffec665ad4e88affe1a64453c7eb9c8ecbb (patch) | |
tree | 8bfb496835be672b7e16d217d4ddc43a1aca490d | |
parent | 36bfde33befc101ad4d10c230b5c44244cb2b3a4 (diff) | |
download | pmwiki.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.php | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |