Merge pull request #10939 from nextcloud/bugfix/10930/perm-checker-wrong-path

Fix path when app has wrong permission
This commit is contained in:
Morris Jobke 2018-08-30 21:43:25 +02:00 committed by GitHub
commit 1ddde36e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -544,18 +544,17 @@ Raw output
*/
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;
}
@ -576,7 +575,7 @@ Raw output
$absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
$appDirUser = posix_getpwuid(fileowner($absAppPath));
if ($appDirUser !== $currentUser) {
$appDirsWithDifferentOwner[] = $absAppPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
$appDirsWithDifferentOwner[] = $absAppPath;
}
}
}