summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJuan Pablo Villafañez <jvillafanez@solidgeargroup.com>2016-08-12 12:05:57 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-08-12 12:05:57 +0200
commit97a86bddfeb0e35ccc3c26b53ea95071ce9064b5 (patch)
tree50d6588531efd1c1eec01362ced261849a08ff3e /apps
parent831e1239cb710fd8a1a4245c9152ef40038c5187 (diff)
downloadnextcloud-server-97a86bddfeb0e35ccc3c26b53ea95071ce9064b5.tar.gz
nextcloud-server-97a86bddfeb0e35ccc3c26b53ea95071ce9064b5.zip
Fix file permissions for SMB (read-only folders will be writeable) (#25734)
Read-only folders won't be deletable
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/smb.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 08c4b25a088..ea07ec1855e 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -363,6 +363,19 @@ class SMB extends Common {
public function isUpdatable($path) {
try {
$info = $this->getFileInfo($path);
+ // following windows behaviour for read-only folders: they can be written into
+ // (https://support.microsoft.com/en-us/kb/326549 - "cause" section)
+ return !$info->isHidden() && (!$info->isReadOnly() || $this->is_dir($path));
+ } catch (NotFoundException $e) {
+ return false;
+ } catch (ForbiddenException $e) {
+ return false;
+ }
+ }
+
+ public function isDeletable($path) {
+ try {
+ $info = $this->getFileInfo($path);
return !$info->isHidden() && !$info->isReadOnly();
} catch (NotFoundException $e) {
return false;