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>
This commit is contained in:
parent
6163351ea2
commit
9d3c7badb5
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue