From 348af5ca3d9f8fb6bbb2cf8afecbc9c791d2db12 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 4 Nov 2014 10:08:04 +0100 Subject: [PATCH] Updated permission check #260 --- php/modules/misc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/php/modules/misc.php b/php/modules/misc.php index 3eb4ad6..420f452 100755 --- a/php/modules/misc.php +++ b/php/modules/misc.php @@ -119,13 +119,16 @@ function get_hashed_password($password) { } -function hasPermissions($path, $permissions = '0777') { +function hasPermissions($path) { /* assume that if running with the same uid as the owner of the directory it's ok */ - $stat = @stat($path); + //$stat = @stat($path); //if ($stat && ($stat['uid'] == getmyuid())) return true; - if (substr(sprintf('%o', @fileperms($path)), -4)!=$permissions) return false; - else return true; + //if (substr(sprintf('%o', @fileperms($path)), -4)!=$permissions) return false; + //else return true; + + if (is_writeable($path)) return true; + return false; }