diff options
author | Joar Wandborg <git@wandborg.com> | 2011-10-11 21:26:35 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-10-11 21:46:14 +0200 |
commit | 9d3c7badb5fd1b9319b35be74e3757702b499d9b (patch) | |
tree | 5181e61bc18b7f0f04e2fb75908295c058880e74 /lib/util.php | |
parent | 6163351ea234cca9ee09d4f040c5cb45e1caf481 (diff) | |
download | nextcloud-server-9d3c7badb5fd1b9319b35be74e3757702b499d9b.tar.gz nextcloud-server-9d3c7badb5fd1b9319b35be74e3757702b499d9b.zip |
Fixed a bug in checkWebserverUser
checkWebserverUser would return the owner of the document
root instead of the owner of the web server process.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php index 4920d13914d..0f8cc08fce6 100644 --- a/lib/util.php +++ b/lib/util.php @@ -271,9 +271,8 @@ class OC_Util { * Try to get the username the httpd server runs on, used in hints */ public static function checkWebserverUser(){ - $stat=stat($_SERVER['DOCUMENT_ROOT']); - if(is_callable('posix_getpwuid')){ - $serverUser=posix_getpwuid($stat['uid']); + if(is_callable('posix_getuid')){ + $serverUser=posix_getpwuid(posix_getuid()); $serverUser='\''.$serverUser['name'].'\''; }elseif(exec('whoami')){ $serverUser=exec('whoami'); |