aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;