Prevent renaming/deleting mount points

Fixed permissions returned for mount points to not include update and
delete permissions.

Fixes #5291
This commit is contained in:
Vincent Petry 2013-10-15 14:55:38 +02:00
parent 8c25b5a0c1
commit 5f249e1a54
1 changed files with 2 additions and 1 deletions

View File

@ -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) {