From: Vincent Petry Date: Tue, 15 Oct 2013 12:55:38 +0000 (+0200) Subject: Prevent renaming/deleting mount points X-Git-Tag: v6.0.0alpha2~4^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f249e1a5474b472f1c597bab0b40c2203a49a91;p=nextcloud-server.git Prevent renaming/deleting mount points Fixed permissions returned for mount points to not include update and delete permissions. Fixes #5291 --- diff --git a/lib/private/files/view.php b/lib/private/files/view.php index a56135d9b3c..c0b9f0fc9c8 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -904,7 +904,8 @@ class View { $permissions = $subStorage->getPermissions($rootEntry['path']); $subPermissionsCache->set($rootEntry['fileid'], $user, $permissions); } - $rootEntry['permissions'] = $permissions; + // do not allow renaming/deleting the mount point + $rootEntry['permissions'] = $permissions & (\OCP\PERMISSION_ALL - (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE)); //remove any existing entry with the same name foreach ($files as $i => $file) {