Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorkesselb <mail@danielkesselberg.de>2021-05-14 23:31:09 +0300
committerGitHub <noreply@github.com>2021-05-14 23:31:09 +0300
commit76dd79056cade5883023b7ef38e968d6e3ab6b51 (patch)
tree713c16fc8d763d598d828786cf70d73c5149a1d9 /apps
parent633200df4ae8bbc3ae6d1de7ad0756c6b6406b0f (diff)
parent945bd042b3acf5045fb596a2435e0e38d6910c0e (diff)
Merge pull request #26966 from nextcloud/backport/26292/stable19
[stable19] ignore readonly flag for directories
Diffstat (limited to 'apps')
-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 cc372dfcaa1..90b99c83985 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) {