diff options
author | Simon L. <szaimen@e.mail.de> | 2024-05-24 14:59:23 +0200 |
---|---|---|
committer | Simon L. <szaimen@e.mail.de> | 2024-05-24 15:00:10 +0200 |
commit | 1afe55bd5f68205645d16a32b56cef2af4f3bb7f (patch) | |
tree | 70d559fbeb42da2ba4a8fbb0bc727118bb3dabdf | |
parent | 137986f30d178cf15a4ded25e906df0e130560dd (diff) | |
download | nextcloud-server-enh/noid/allow-configure-config.owner.tar.gz nextcloud-server-enh/noid/allow-configure-config.owner.zip |
fix: address review 2enh/noid/allow-configure-config.owner
Signed-off-by: Simon L <szaimen@e.mail.de>
-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; |