Skip to content

Commit

Permalink
fix(posix_getpwuid): handle false return value
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed May 22, 2024
1 parent 087ba07 commit a0d9dca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion console.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function exceptionHandler($exception) {
}

$user = posix_getuid();
$userName = posix_getpwuid($user)['name'];
$userName = posix_getpwuid($user) !== false ? posix_getpwuid($user)['name'] : '';
$configUser = fileowner(OC::$configDir . 'config.php');
$configuredUser = $config->getSystemValueString('php.user', '');
if ($user !== $configUser && $userName !== $configuredUser) {
Expand Down
2 changes: 1 addition & 1 deletion cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
}

$user = posix_getuid();
$userName = posix_getpwuid($user)['name'];
$userName = posix_getpwuid($user) !== false ? posix_getpwuid($user)['name'] : '';
$configUser = fileowner(OC::$configDir . 'config.php');
$configuredUser = $config->getSystemValueString('php.user', '');
if ($user !== $configUser && $userName !== $configuredUser) {
Expand Down

0 comments on commit a0d9dca

Please sign in to comment.