summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-08-04 19:48:21 +0200
committerGitHub <noreply@github.com>2016-08-04 19:48:21 +0200
commite1807ed0a404bdb6ae9fe1de79e226ee72ef7408 (patch)
tree63a0dc9adea0b0f8c3944867facc1687de15a2f4 /apps
parentb5c2b5e882cffb32997b7016d938ae93a62f557e (diff)
parentc376eb9f90dbf51c35d9997f36c275a9ba780e82 (diff)
downloadnextcloud-server-e1807ed0a404bdb6ae9fe1de79e226ee72ef7408.tar.gz
nextcloud-server-e1807ed0a404bdb6ae9fe1de79e226ee72ef7408.zip
Merge pull request #465 from nextcloud/fix_smb_attributes
Fix file permissions for SMB (read-only folders will be writeable) (#…
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 50ea186060a..28445dd2f61 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -397,6 +397,19 @@ class SMB extends Common implements INotifyStorage {
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;