Prevent renaming/deleting mount points

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

Fixes #5291
remotes/origin/stable6
Vincent Petry 12 years ago
parent 8c25b5a0c1
commit 5f249e1a54
  1. 3
      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) {

Loading…
Cancel
Save