]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent renaming/deleting mount points
authorVincent Petry <pvince81@owncloud.com>
Tue, 15 Oct 2013 12:55:38 +0000 (14:55 +0200)
committerVincent Petry <pvince81@owncloud.com>
Tue, 15 Oct 2013 12:58:58 +0000 (14:58 +0200)
Fixed permissions returned for mount points to not include update and
delete permissions.

Fixes #5291

lib/private/files/view.php

index a56135d9b3cafe8589dcf85f86ea88dfab957018..c0b9f0fc9c8d5e8149b8c69d683d8f2ce64815a7 100644 (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) {