Skip to content
Snippets Groups Projects
Commit 9d3c7bad authored by Joar Wandborg's avatar Joar Wandborg Committed by Florian Pritz
Browse files

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: default avatarFlorian Pritz <bluewind@xinu.at>
parent 6163351e
No related branches found
No related tags found
No related merge requests found
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment