summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-15 14:55:38 +0200
committerVincent Petry <pvince81@owncloud.com>2013-10-15 14:58:58 +0200
commit5f249e1a5474b472f1c597bab0b40c2203a49a91 (patch)
tree67ecab054ed0fbcd9bb692241a44681d36f6d6b8 /lib
parent8c25b5a0c168553d22de40dcbf7d1db557cf1a00 (diff)
downloadnextcloud-server-5f249e1a5474b472f1c597bab0b40c2203a49a91.tar.gz
nextcloud-server-5f249e1a5474b472f1c597bab0b40c2203a49a91.zip
Prevent renaming/deleting mount points
Fixed permissions returned for mount points to not include update and delete permissions. Fixes #5291
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php3
1 files changed, 2 insertions, 1 deletions
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) {