summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJuan Pablo Villafañez <jvillafanez@solidgeargroup.com>2016-08-12 12:06:30 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-08-12 12:06:30 +0200
commita986fd4b79099ca821b7ac0bed291c036e0db782 (patch)
treebc7e33f77062b1c4cce2c1a009bf587455280d5d /apps
parent6e44ef83ff22163815d77b149b4da5bc705463ad (diff)
downloadnextcloud-server-a986fd4b79099ca821b7ac0bed291c036e0db782.tar.gz
nextcloud-server-a986fd4b79099ca821b7ac0bed291c036e0db782.zip
[stable9.1] Fix smb attributes stable9 1 (#25733)
* Fix file permissions for SMB (read-only folders will be writeable) * Read-only folders won't be deletable * Added comment for the read-only behaviour for folders
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 9f74aa881e0..fce70182150 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -383,6 +383,19 @@ class SMB extends \OC\Files\Storage\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;