mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 18:21:40 -04:00
Remove posix_getpwuid and compare only userid
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
4165f332de
commit
53ecdfec51
1 changed files with 4 additions and 4 deletions
|
|
@ -543,7 +543,7 @@ Raw output
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function getAppDirsWithDifferentOwner(): array {
|
protected function getAppDirsWithDifferentOwner(): array {
|
||||||
$currentUser = posix_getpwuid(posix_getuid());
|
$currentUser = posix_getuid();
|
||||||
$appDirsWithDifferentOwner = [[]];
|
$appDirsWithDifferentOwner = [[]];
|
||||||
|
|
||||||
foreach (OC::$APPSROOTS as $appRoot) {
|
foreach (OC::$APPSROOTS as $appRoot) {
|
||||||
|
|
@ -561,11 +561,11 @@ Raw output
|
||||||
/**
|
/**
|
||||||
* Tests if the directories for one apps directory are writable by the current user.
|
* Tests if the directories for one apps directory are writable by the current user.
|
||||||
*
|
*
|
||||||
* @param array $currentUser The current user
|
* @param int $currentUser The current user
|
||||||
* @param array $appRoot The app root config
|
* @param array $appRoot The app root config
|
||||||
* @return string[] The none writable directory paths inside the app root
|
* @return string[] The none writable directory paths inside the app root
|
||||||
*/
|
*/
|
||||||
private function getAppDirsWithDifferentOwnerForAppRoot(array $currentUser, array $appRoot): array {
|
private function getAppDirsWithDifferentOwnerForAppRoot($currentUser, array $appRoot): array {
|
||||||
$appDirsWithDifferentOwner = [];
|
$appDirsWithDifferentOwner = [];
|
||||||
$appsPath = $appRoot['path'];
|
$appsPath = $appRoot['path'];
|
||||||
$appsDir = new DirectoryIterator($appRoot['path']);
|
$appsDir = new DirectoryIterator($appRoot['path']);
|
||||||
|
|
@ -573,7 +573,7 @@ Raw output
|
||||||
foreach ($appsDir as $fileInfo) {
|
foreach ($appsDir as $fileInfo) {
|
||||||
if ($fileInfo->isDir() && !$fileInfo->isDot()) {
|
if ($fileInfo->isDir() && !$fileInfo->isDot()) {
|
||||||
$absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
|
$absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
|
||||||
$appDirUser = posix_getpwuid(fileowner($absAppPath));
|
$appDirUser = fileowner($absAppPath);
|
||||||
if ($appDirUser !== $currentUser) {
|
if ($appDirUser !== $currentUser) {
|
||||||
$appDirsWithDifferentOwner[] = $absAppPath;
|
$appDirsWithDifferentOwner[] = $absAppPath;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue