Commit 3473248b authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #545 in ZP/z-push from bugfix/ZP-1223-mess-up-dev-null to develop

* commit '04dabc49':
  ZP-1223 Make sure that the file is a real file and not a special file.
parents 2aca0e29 04dabc49
......@@ -864,6 +864,7 @@ class Utils {
/**
* Checks if a file has the same owner and group as the parent directory.
* If not, owner and group are fixed (being updated to the owner/group of the directory).
* If the given file is a special file (i.g., /dev/null, fifo), nothing is changed.
* Function code contributed by Robert Scheck aka rsc.
*
* @param string $file
......@@ -872,7 +873,7 @@ class Utils {
* @return boolean
*/
public static function FixFileOwner($file) {
if(posix_getuid() == 0 && file_exists($file)) {
if(posix_getuid() == 0 && is_file($file)) {
$dir = dirname($file);
$perm_dir = stat($dir);
$perm_file = stat($file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment