diff options
-rw-r--r-- | console.php | 3 | ||||
-rw-r--r-- | cron.php | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/console.php b/console.php index 355b62ca2e6..b2bc50c13d0 100644 --- a/console.php +++ b/console.php @@ -43,12 +43,13 @@ try { $user = posix_getuid(); $userNameArray = posix_getpwuid($user); + $username = null; if ($userNameArray !== false) { $userName = $userNameArray['name']; } $configUser = fileowner(OC::$configDir . 'config.php'); $configuredUser = $config->getSystemValueString('php.user', ''); - if ($user !== $configUser && $userName !== $configuredUser) { + if ($user !== $configUser && $username !== null && $userName !== $configuredUser) { echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL; echo "Current user id: " . $user . PHP_EOL; echo "Owner id of config.php: " . $configUser . PHP_EOL; @@ -131,12 +131,13 @@ Options: $user = posix_getuid(); $userNameArray = posix_getpwuid($user); - if ($userNameArray !== false)) { + $username = null; + if ($userNameArray !== false) { $userName = $userNameArray['name']; } $configUser = fileowner(OC::$configDir . 'config.php'); $configuredUser = $config->getSystemValueString('php.user', ''); - if ($user !== $configUser && $userName !== $configuredUser) { + if ($user !== $configUser && $username !== null && $userName !== $configuredUser) { echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL; echo "Current user id: " . $user . PHP_EOL; echo "Owner id of config.php: " . $configUser . PHP_EOL; |