diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json index 0ee0c268bb..514108214d 100644 --- a/apps/files_external/3rdparty/composer.json +++ b/apps/files_external/3rdparty/composer.json @@ -9,6 +9,6 @@ }, "require": { "icewind/streams": "0.7.1", - "icewind/smb": "3.2.3" + "icewind/smb": "3.2.4" } } diff --git a/apps/files_external/3rdparty/composer.lock b/apps/files_external/3rdparty/composer.lock index e0716141c5..aae061de55 100644 --- a/apps/files_external/3rdparty/composer.lock +++ b/apps/files_external/3rdparty/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef0d9929f5f25696e010d5733eb51fbb", + "content-hash": "9454f546b6ab8865140c991e8f197951", "packages": [ { "name": "icewind/smb", - "version": "v3.2.3", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/icewind1991/SMB.git", - "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4" + "reference": "999d6687ca9d4ac2600185c935b45206e47e604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4", - "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4", + "url": "https://api.github.com/repos/icewind1991/SMB/zipball/999d6687ca9d4ac2600185c935b45206e47e604a", + "reference": "999d6687ca9d4ac2600185c935b45206e47e604a", "shasum": "" }, "require": { @@ -46,7 +46,7 @@ } ], "description": "php wrapper for smbclient and libsmbclient-php", - "time": "2020-04-08T15:20:22+00:00" + "time": "2020-05-11T14:12:35+00:00" }, { "name": "icewind/streams", diff --git a/apps/files_external/3rdparty/composer/installed.json b/apps/files_external/3rdparty/composer/installed.json index e2b841f206..388a48e556 100644 --- a/apps/files_external/3rdparty/composer/installed.json +++ b/apps/files_external/3rdparty/composer/installed.json @@ -1,17 +1,17 @@ [ { "name": "icewind/smb", - "version": "v3.2.3", - "version_normalized": "3.2.3.0", + "version": "v3.2.4", + "version_normalized": "3.2.4.0", "source": { "type": "git", "url": "https://github.com/icewind1991/SMB.git", - "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4" + "reference": "999d6687ca9d4ac2600185c935b45206e47e604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4", - "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4", + "url": "https://api.github.com/repos/icewind1991/SMB/zipball/999d6687ca9d4ac2600185c935b45206e47e604a", + "reference": "999d6687ca9d4ac2600185c935b45206e47e604a", "shasum": "" }, "require": { @@ -22,7 +22,7 @@ "friendsofphp/php-cs-fixer": "^2.13", "phpunit/phpunit": "^7.0" }, - "time": "2020-04-08T15:20:22+00:00", + "time": "2020-05-11T14:12:35+00:00", "type": "library", "installation-source": "dist", "autoload": { 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 24344e6f0d..093cbb3b5d 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php @@ -31,11 +31,6 @@ class NativeFileInfo implements IFileInfo { */ protected $attributeCache = null; - /** - * @var int - */ - protected $modeCache; - /** * @param NativeShare $share * @param string $path @@ -69,7 +64,7 @@ class NativeFileInfo implements IFileInfo { $rawAttributes = explode(',', $this->share->getAttribute($this->path, 'system.dos_attr.*')); $this->attributeCache = []; foreach ($rawAttributes as $rawAttribute) { - [$name, $value] = explode(':', $rawAttribute); + list($name, $value) = explode(':', $rawAttribute); $name = strtolower($name); if ($name == 'mode') { $this->attributeCache[$name] = (int)hexdec(substr($value, 2)); @@ -97,6 +92,18 @@ class NativeFileInfo implements IFileInfo { return $stat['change_time']; } + /** + * On "mode": + * + * different smbclient versions seem to return different mode values for 'system.dos_attr.mode' + * + * older versions return the dos permissions mask as defined in `IFileInfo::MODE_*` while + * newer versions return the equivalent unix permission mask. + * + * Since the unix mask doesn't contain the proper hidden/archive/system flags we have to assume them + * as false (except for `hidden` where we use the unix dotfile convention) + */ + /** * @return int */ @@ -109,7 +116,11 @@ class NativeFileInfo implements IFileInfo { */ public function isDirectory() { $mode = $this->getMode(); - return (bool)($mode & IFileInfo::MODE_DIRECTORY); + if ($mode > 0x80) { + return (bool)($mode & 0x4000); // 0x80: unix directory flag + } else { + return (bool)($mode & IFileInfo::MODE_DIRECTORY); + } } /** @@ -117,7 +128,11 @@ class NativeFileInfo implements IFileInfo { */ public function isReadOnly() { $mode = $this->getMode(); - return (bool)($mode & IFileInfo::MODE_READONLY); + if ($mode > 0x80) { + return !(bool)($mode & 0x80); // 0x80: owner write permissions + } else { + return (bool)($mode & IFileInfo::MODE_READONLY); + } } /** @@ -125,7 +140,11 @@ class NativeFileInfo implements IFileInfo { */ public function isHidden() { $mode = $this->getMode(); - return (bool)($mode & IFileInfo::MODE_HIDDEN); + if ($mode > 0x80) { + return $this->name[0] === '.'; + } else { + return (bool)($mode & IFileInfo::MODE_HIDDEN); + } } /** @@ -133,7 +152,11 @@ class NativeFileInfo implements IFileInfo { */ public function isSystem() { $mode = $this->getMode(); - return (bool)($mode & IFileInfo::MODE_SYSTEM); + if ($mode > 0x80) { + return false; + } else { + return (bool)($mode & IFileInfo::MODE_SYSTEM); + } } /** @@ -141,7 +164,11 @@ class NativeFileInfo implements IFileInfo { */ public function isArchived() { $mode = $this->getMode(); - return (bool)($mode & IFileInfo::MODE_ARCHIVE); + if ($mode > 0x80) { + return false; + } else { + return (bool)($mode & IFileInfo::MODE_ARCHIVE); + } } /** @@ -152,8 +179,8 @@ class NativeFileInfo implements IFileInfo { $attribute = $this->share->getAttribute($this->path, 'system.nt_sec_desc.acl.*+'); foreach (explode(',', $attribute) as $acl) { - [$user, $permissions] = explode(':', $acl, 2); - [$type, $flags, $mask] = explode('/', $permissions); + list($user, $permissions) = explode(':', $acl, 2); + list($type, $flags, $mask) = explode('/', $permissions); $mask = hexdec($mask); $acls[$user] = new ACL($type, $flags, $mask);