aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/common.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-19 12:59:10 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-19 12:59:10 +0100
commita9e0cfad8b3d90c81b53e7d4b2382e559a4cec94 (patch)
treec72e5c980ba67370402587fea2fa28a917b769e8 /lib/private/files/storage/common.php
parentae2304f23f04f1d6c84f2a049a4b0fdc0c9023c6 (diff)
downloadnextcloud-server-a9e0cfad8b3d90c81b53e7d4b2382e559a4cec94.tar.gz
nextcloud-server-a9e0cfad8b3d90c81b53e7d4b2382e559a4cec94.zip
Check delete permission before attemping copy+delete
Some move operations when cross-storage will be replaced by copy and delete. Before attempting this, first check whether the source storage has delete permissions. This also prevents renaming system-wide external storages.
Diffstat (limited to 'lib/private/files/storage/common.php')
-rw-r--r--lib/private/files/storage/common.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index edc570c967d..1d4801e5b97 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -613,6 +613,10 @@ abstract class Common implements Storage, ILockingStorage {
return $this->rename($sourceInternalPath, $targetInternalPath);
}
+ if (!$sourceStorage->isDeletable($sourceInternalPath)) {
+ return false;
+ }
+
$result = $this->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, true);
if ($result) {
if ($sourceStorage->is_dir($sourceInternalPath)) {