summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-19 16:06:55 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-19 16:06:55 +0100
commitfb38625741f6e8ca2d9601830a5afa537d43f8ce (patch)
tree3c101d6399c6798f5b6eac767fc526bb3dd6db9a /lib
parentb5281b61ed90d815deb8bdb4d94b53a0c3fc0e64 (diff)
parenta9e0cfad8b3d90c81b53e7d4b2382e559a4cec94 (diff)
downloadnextcloud-server-fb38625741f6e8ca2d9601830a5afa537d43f8ce.tar.gz
nextcloud-server-fb38625741f6e8ca2d9601830a5afa537d43f8ce.zip
Merge pull request #22518 from owncloud/checkdeletebeforecopyinsteadofrename
Check delete permission before attemping copy+delete
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/common.php4
-rw-r--r--lib/private/files/storage/wrapper/encryption.php4
2 files changed, 8 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)) {
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index 26905dfb388..11c6084d00c 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -459,6 +459,10 @@ class Encryption extends Wrapper {
// - copy the copyKeys() call from $this->copyBetweenStorage to this method
// - remove $this->copyBetweenStorage
+ if (!$sourceStorage->isDeletable($sourceInternalPath)) {
+ return false;
+ }
+
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true);
if ($result) {
if ($sourceStorage->is_dir($sourceInternalPath)) {