Skip to content

Commit

Permalink
Fix path when app has wrong permission
Browse files Browse the repository at this point in the history
  • Loading branch information
kesselb committed Aug 30, 2018
1 parent ce87537 commit a6bb19f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions settings/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,18 +544,17 @@ protected function hasOpcacheLoaded(): bool {
*/
protected function getAppDirsWithDifferentOwner(): array {
$currentUser = posix_getpwuid(posix_getuid());
$appDirsWithDifferentOwner = [];
$appDirsWithDifferentOwner = [[]];

foreach (OC::$APPSROOTS as $appRoot) {
if ($appRoot['writable'] === true) {
$appDirsWithDifferentOwner = array_merge(
$appDirsWithDifferentOwner,
$this->getAppDirsWithDifferentOwnerForAppRoot($currentUser, $appRoot)
);
$appDirsWithDifferentOwner[] = $this->getAppDirsWithDifferentOwnerForAppRoot($currentUser, $appRoot);
}
}

$appDirsWithDifferentOwner = array_merge(...$appDirsWithDifferentOwner);
sort($appDirsWithDifferentOwner);

return $appDirsWithDifferentOwner;
}

Expand All @@ -576,7 +575,7 @@ private function getAppDirsWithDifferentOwnerForAppRoot(array $currentUser, arra
$absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
$appDirUser = posix_getpwuid(fileowner($absAppPath));
if ($appDirUser !== $currentUser) {
$appDirsWithDifferentOwner[] = $absAppPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
$appDirsWithDifferentOwner[] = $absAppPath;
}
}
}
Expand Down

0 comments on commit a6bb19f

Please sign in to comment.