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
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-12 18:09:28 +0300
committerRobin Appelman <robin@icewind.nl>2021-03-12 18:11:42 +0300
commitb04ef9afde1dcbfbde4958c080a32b3c57ef8ea6 (patch)
tree6a6811f0db814772c18a62e347d4adb1327f98a0
parentbf39adb49b5f102ef898feed6520df672612d15e (diff)
debug mode when readonly is detected
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php
index d8be57c7311..3e387c416ba 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php
@@ -64,10 +64,19 @@ class NativeFileInfo implements IFileInfo {
$rawAttributes = explode(',', $this->share->getAttribute($this->path, 'system.dos_attr.*'));
$this->attributeCache = [];
foreach ($rawAttributes as $rawAttribute) {
- list($name, $value) = explode(':', $rawAttribute);
+ [$name, $value] = explode(':', $rawAttribute);
$name = strtolower($name);
if ($name == 'mode') {
- $this->attributeCache[$name] = (int)hexdec(substr($value, 2));
+ $mode = (int)hexdec(substr($value, 2));
+ if ($mode > 0x1000) {
+ $readonly = !(bool)($mode & 0x80); // 0x80: owner write permissions
+ } else {
+ $readonly = (bool)($mode & IFileInfo::MODE_READONLY);
+ }
+ if ($readonly) {
+ \OC::$server->getLogger()->warning("Readonly file mode $value for ". $this->path);
+ }
+ $this->attributeCache[$name] = $mode;
} else {
$this->attributeCache[$name] = (int)$value;
}
@@ -112,7 +121,7 @@ class NativeFileInfo implements IFileInfo {
// Let us ignore the ATTR_NOT_CONTENT_INDEXED for now
$mode &= ~0x00002000;
-
+
return $mode;
}