From 5d38e80cf06e5e76a0e5edc23736449b67a0b81c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 12 May 2020 14:39:08 +0200 Subject: [PATCH] update icewind/smb to 3.2.4 Signed-off-by: Robin Appelman --- apps/files_external/3rdparty/composer.json | 2 +- apps/files_external/3rdparty/composer.lock | 12 ++--- .../3rdparty/composer/autoload_classmap.php | 10 ---- .../3rdparty/composer/autoload_static.php | 10 ---- .../3rdparty/composer/installed.json | 12 ++--- .../icewind/smb/src/Native/NativeFileInfo.php | 53 ++++++++++++++----- 6 files changed, 53 insertions(+), 46 deletions(-) diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json index 483e92eb427..62eb72cb6b1 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 83a165cc1dd..19231a5da82 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": "ceb6bef26683b2d8f92ee654bd63853c", + "content-hash": "ab745d51b0d201a3c3d3f78e5cb865c1", "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/autoload_classmap.php b/apps/files_external/3rdparty/composer/autoload_classmap.php index 5e812cf4fdb..a563765eb9b 100644 --- a/apps/files_external/3rdparty/composer/autoload_classmap.php +++ b/apps/files_external/3rdparty/composer/autoload_classmap.php @@ -58,16 +58,6 @@ return array( 'Icewind\\SMB\\Options' => $vendorDir . '/icewind/smb/src/Options.php', 'Icewind\\SMB\\ServerFactory' => $vendorDir . '/icewind/smb/src/ServerFactory.php', 'Icewind\\SMB\\System' => $vendorDir . '/icewind/smb/src/System.php', - 'Icewind\\SMB\\Test\\AbstractShareTest' => $vendorDir . '/icewind/smb/tests/AbstractShareTest.php', - 'Icewind\\SMB\\Test\\NativeShareTest' => $vendorDir . '/icewind/smb/tests/NativeShareTest.php', - 'Icewind\\SMB\\Test\\NativeStreamTest' => $vendorDir . '/icewind/smb/tests/NativeStreamTest.php', - 'Icewind\\SMB\\Test\\NotifyHandlerTest' => $vendorDir . '/icewind/smb/tests/NotifyHandlerTest.php', - 'Icewind\\SMB\\Test\\ParserTest' => $vendorDir . '/icewind/smb/tests/ParserTest.php', - 'Icewind\\SMB\\Test\\ServerFactoryTest' => $vendorDir . '/icewind/smb/tests/ServerFactoryTest.php', - 'Icewind\\SMB\\Test\\ServerTest' => $vendorDir . '/icewind/smb/tests/ServerTest.php', - 'Icewind\\SMB\\Test\\ShareTest' => $vendorDir . '/icewind/smb/tests/ShareTest.php', - 'Icewind\\SMB\\Test\\TestCase' => $vendorDir . '/icewind/smb/tests/TestCase.php', - 'Icewind\\SMB\\Test\\TimeZoneProviderTest' => $vendorDir . '/icewind/smb/tests/TimeZoneProviderTest.php', 'Icewind\\SMB\\TimeZoneProvider' => $vendorDir . '/icewind/smb/src/TimeZoneProvider.php', 'Icewind\\SMB\\Wrapped\\Connection' => $vendorDir . '/icewind/smb/src/Wrapped/Connection.php', 'Icewind\\SMB\\Wrapped\\ErrorCodes' => $vendorDir . '/icewind/smb/src/Wrapped/ErrorCodes.php', diff --git a/apps/files_external/3rdparty/composer/autoload_static.php b/apps/files_external/3rdparty/composer/autoload_static.php index 0bef5d984e2..fc6e68f8be4 100644 --- a/apps/files_external/3rdparty/composer/autoload_static.php +++ b/apps/files_external/3rdparty/composer/autoload_static.php @@ -88,16 +88,6 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3 'Icewind\\SMB\\Options' => __DIR__ . '/..' . '/icewind/smb/src/Options.php', 'Icewind\\SMB\\ServerFactory' => __DIR__ . '/..' . '/icewind/smb/src/ServerFactory.php', 'Icewind\\SMB\\System' => __DIR__ . '/..' . '/icewind/smb/src/System.php', - 'Icewind\\SMB\\Test\\AbstractShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/AbstractShareTest.php', - 'Icewind\\SMB\\Test\\NativeShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeShareTest.php', - 'Icewind\\SMB\\Test\\NativeStreamTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeStreamTest.php', - 'Icewind\\SMB\\Test\\NotifyHandlerTest' => __DIR__ . '/..' . '/icewind/smb/tests/NotifyHandlerTest.php', - 'Icewind\\SMB\\Test\\ParserTest' => __DIR__ . '/..' . '/icewind/smb/tests/ParserTest.php', - 'Icewind\\SMB\\Test\\ServerFactoryTest' => __DIR__ . '/..' . '/icewind/smb/tests/ServerFactoryTest.php', - 'Icewind\\SMB\\Test\\ServerTest' => __DIR__ . '/..' . '/icewind/smb/tests/ServerTest.php', - 'Icewind\\SMB\\Test\\ShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/ShareTest.php', - 'Icewind\\SMB\\Test\\TestCase' => __DIR__ . '/..' . '/icewind/smb/tests/TestCase.php', - 'Icewind\\SMB\\Test\\TimeZoneProviderTest' => __DIR__ . '/..' . '/icewind/smb/tests/TimeZoneProviderTest.php', 'Icewind\\SMB\\TimeZoneProvider' => __DIR__ . '/..' . '/icewind/smb/src/TimeZoneProvider.php', 'Icewind\\SMB\\Wrapped\\Connection' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/Connection.php', 'Icewind\\SMB\\Wrapped\\ErrorCodes' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/ErrorCodes.php', diff --git a/apps/files_external/3rdparty/composer/installed.json b/apps/files_external/3rdparty/composer/installed.json index e2b841f206a..388a48e5560 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 24344e6f0df..093cbb3b5dc 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); -- 2.39.5