summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-25 12:03:09 +0100
committerRobin Appelman <robin@icewind.nl>2021-03-25 12:03:09 +0100
commit43f70e5817d58d8e4736b5305cba61c6a3864581 (patch)
tree887eb160b93956739a5a2dfc48866f3d918c09d2 /apps/files_external
parentf97491eb8f13099a31a984477f67eb55b1f333f7 (diff)
downloadnextcloud-server-43f70e5817d58d8e4736b5305cba61c6a3864581.tar.gz
nextcloud-server-43f70e5817d58d8e4736b5305cba61c6a3864581.zip
ignore readonly flag for directories
see http://support.microsoft.com/kb/326549 Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 45a01db76b3..1151d76c5e4 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -97,9 +97,6 @@ class SMB extends Common implements INotifyStorage {
/** @var bool */
protected $checkAcl;
- /** @var bool */
- protected $rootWritable;
-
public function __construct($params) {
if (!isset($params['host'])) {
throw new \Exception('Invalid configuration, no host provided');
@@ -137,7 +134,6 @@ class SMB extends Common implements INotifyStorage {
$this->showHidden = isset($params['show_hidden']) && $params['show_hidden'];
$this->checkAcl = isset($params['check_acl']) && $params['check_acl'];
- $this->rootWritable = isset($params['root_force_writable']) && $params['root_force_writable'];
$this->statCache = new CappedMemoryCache();
parent::__construct($params);
@@ -578,9 +574,7 @@ class SMB extends Common implements INotifyStorage {
$permissions = Constants::PERMISSION_READ + Constants::PERMISSION_SHARE;
if (
- !$fileInfo->isReadOnly() || (
- $this->rootWritable && $fileInfo->getPath() == $this->buildPath('')
- )
+ !$fileInfo->isReadOnly() || $fileInfo->isDirectory()
) {
$permissions += Constants::PERMISSION_DELETE;
$permissions += Constants::PERMISSION_UPDATE;
@@ -683,7 +677,7 @@ class SMB extends Common implements INotifyStorage {
$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 ($this->showHidden || !$info->isHidden()) && (!$info->isReadOnly() || $this->is_dir($path));
+ return ($this->showHidden || !$info->isHidden()) && (!$info->isReadOnly() || $info->isDirectory());
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {