diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json index 9cf429eb5c..0ee0c268bb 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.1" + "icewind/smb": "3.2.3" } } diff --git a/apps/files_external/3rdparty/composer.lock b/apps/files_external/3rdparty/composer.lock index c486854d6a..e0716141c5 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": "adc3b3531ee8503b485092e60c569b42", + "content-hash": "ef0d9929f5f25696e010d5733eb51fbb", "packages": [ { "name": "icewind/smb", - "version": "v3.2.1", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/icewind1991/SMB.git", - "reference": "5330edcc579a2dcc4759b8e5779eb5aa3385a878" + "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SMB/zipball/5330edcc579a2dcc4759b8e5779eb5aa3385a878", - "reference": "5330edcc579a2dcc4759b8e5779eb5aa3385a878", + "url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4", + "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4", "shasum": "" }, "require": { @@ -46,7 +46,7 @@ } ], "description": "php wrapper for smbclient and libsmbclient-php", - "time": "2020-03-24T18:19:18+00:00" + "time": "2020-04-08T15:20:22+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 5b0c682cbc..a563765eb9 100644 --- a/apps/files_external/3rdparty/composer/autoload_classmap.php +++ b/apps/files_external/3rdparty/composer/autoload_classmap.php @@ -16,8 +16,10 @@ return array( 'Icewind\\SMB\\Exception\\AlreadyExistsException' => $vendorDir . '/icewind/smb/src/Exception/AlreadyExistsException.php', 'Icewind\\SMB\\Exception\\AuthenticationException' => $vendorDir . '/icewind/smb/src/Exception/AuthenticationException.php', 'Icewind\\SMB\\Exception\\ConnectException' => $vendorDir . '/icewind/smb/src/Exception/ConnectException.php', + 'Icewind\\SMB\\Exception\\ConnectionAbortedException' => $vendorDir . '/icewind/smb/src/Exception/ConnectionAbortedException.php', 'Icewind\\SMB\\Exception\\ConnectionException' => $vendorDir . '/icewind/smb/src/Exception/ConnectionException.php', 'Icewind\\SMB\\Exception\\ConnectionRefusedException' => $vendorDir . '/icewind/smb/src/Exception/ConnectionRefusedException.php', + 'Icewind\\SMB\\Exception\\ConnectionResetException' => $vendorDir . '/icewind/smb/src/Exception/ConnectionResetException.php', 'Icewind\\SMB\\Exception\\DependencyException' => $vendorDir . '/icewind/smb/src/Exception/DependencyException.php', 'Icewind\\SMB\\Exception\\Exception' => $vendorDir . '/icewind/smb/src/Exception/Exception.php', 'Icewind\\SMB\\Exception\\FileInUseException' => $vendorDir . '/icewind/smb/src/Exception/FileInUseException.php', diff --git a/apps/files_external/3rdparty/composer/autoload_static.php b/apps/files_external/3rdparty/composer/autoload_static.php index b8eb6ebbfe..fc6e68f8be 100644 --- a/apps/files_external/3rdparty/composer/autoload_static.php +++ b/apps/files_external/3rdparty/composer/autoload_static.php @@ -46,8 +46,10 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3 'Icewind\\SMB\\Exception\\AlreadyExistsException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/AlreadyExistsException.php', 'Icewind\\SMB\\Exception\\AuthenticationException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/AuthenticationException.php', 'Icewind\\SMB\\Exception\\ConnectException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/ConnectException.php', + 'Icewind\\SMB\\Exception\\ConnectionAbortedException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/ConnectionAbortedException.php', 'Icewind\\SMB\\Exception\\ConnectionException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/ConnectionException.php', 'Icewind\\SMB\\Exception\\ConnectionRefusedException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/ConnectionRefusedException.php', + 'Icewind\\SMB\\Exception\\ConnectionResetException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/ConnectionResetException.php', 'Icewind\\SMB\\Exception\\DependencyException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/DependencyException.php', 'Icewind\\SMB\\Exception\\Exception' => __DIR__ . '/..' . '/icewind/smb/src/Exception/Exception.php', 'Icewind\\SMB\\Exception\\FileInUseException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/FileInUseException.php', diff --git a/apps/files_external/3rdparty/composer/installed.json b/apps/files_external/3rdparty/composer/installed.json index e3609f5af4..e2b841f206 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.1", - "version_normalized": "3.2.1.0", + "version": "v3.2.3", + "version_normalized": "3.2.3.0", "source": { "type": "git", "url": "https://github.com/icewind1991/SMB.git", - "reference": "5330edcc579a2dcc4759b8e5779eb5aa3385a878" + "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SMB/zipball/5330edcc579a2dcc4759b8e5779eb5aa3385a878", - "reference": "5330edcc579a2dcc4759b8e5779eb5aa3385a878", + "url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4", + "reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4", "shasum": "" }, "require": { @@ -22,7 +22,7 @@ "friendsofphp/php-cs-fixer": "^2.13", "phpunit/phpunit": "^7.0" }, - "time": "2020-03-24T18:19:18+00:00", + "time": "2020-04-08T15:20:22+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionAbortedException.php b/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionAbortedException.php new file mode 100644 index 0000000000..59363ca7ba --- /dev/null +++ b/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionAbortedException.php @@ -0,0 +1,11 @@ + + * This file is licensed under the Licensed under the MIT license: + * http://opensource.org/licenses/MIT + */ + +namespace Icewind\SMB\Exception; + +class ConnectionAbortedException extends ConnectException { +} diff --git a/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionResetException.php b/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionResetException.php new file mode 100644 index 0000000000..d5ac10d32d --- /dev/null +++ b/apps/files_external/3rdparty/icewind/smb/src/Exception/ConnectionResetException.php @@ -0,0 +1,11 @@ + + * This file is licensed under the Licensed under the MIT license: + * http://opensource.org/licenses/MIT + */ + +namespace Icewind\SMB\Exception; + +class ConnectionResetException extends ConnectException { +} diff --git a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php index 26e7adb019..e829be28bf 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php @@ -197,12 +197,14 @@ class NativeShare extends AbstractShare { */ public function put($source, $target) { $sourceHandle = fopen($source, 'rb'); - $targetHandle = $this->getState()->create($this->buildUrl($target)); + $targetUrl = $this->buildUrl($target); + + $targetHandle = $this->getState()->create($targetUrl); while ($data = fread($sourceHandle, NativeReadStream::CHUNK_SIZE)) { - $this->getState()->write($targetHandle, $data); + $this->getState()->write($targetHandle, $data, $targetUrl); } - $this->getState()->close($targetHandle); + $this->getState()->close($targetHandle, $targetUrl); return true; } @@ -236,14 +238,14 @@ class NativeShare extends AbstractShare { } else { $reason = 'Unknown error'; } - $this->getState()->close($sourceHandle); + $this->getState()->close($sourceHandle, $this->buildUrl($source)); throw new InvalidResourceException('Failed opening local file "' . $target . '" for writing: ' . $reason); } while ($data = $this->getState()->read($sourceHandle, NativeReadStream::CHUNK_SIZE)) { fwrite($targetHandle, $data); } - $this->getState()->close($sourceHandle); + $this->getState()->close($sourceHandle, $this->buildUrl($source)); return true; } diff --git a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php index 0792b2f9d7..3bfb1c3da2 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php @@ -16,6 +16,7 @@ use Icewind\SMB\Exception\ForbiddenException; use Icewind\SMB\Exception\HostDownException; use Icewind\SMB\Exception\InvalidArgumentException; use Icewind\SMB\Exception\InvalidTypeException; +use Icewind\SMB\Exception\ConnectionAbortedException; use Icewind\SMB\Exception\NoRouteToHostException; use Icewind\SMB\Exception\NotEmptyException; use Icewind\SMB\Exception\NotFoundException; @@ -49,6 +50,7 @@ class NativeState { 22 => InvalidArgumentException::class, 28 => OutOfSpaceException::class, 39 => NotEmptyException::class, + 103 => ConnectionAbortedException::class, 104 => ConnectionResetException::class, 110 => TimedOutException::class, 111 => ConnectionRefusedException::class, @@ -238,13 +240,14 @@ class NativeState { /** * @param resource $file * @param string $data + * @param string $path * @param int $length * @return int */ - public function write($file, $data, $length = null) { + public function write($file, $data, $path, $length = null) { $result = @smbclient_write($this->state, $file, $data, $length); - $this->testResult($result, $file); + $this->testResult($result, $path); return $result; } @@ -273,10 +276,10 @@ class NativeState { return $result; } - public function close($file) { + public function close($file, $path) { $result = @smbclient_close($this->state, $file); - $this->testResult($result, $file); + $this->testResult($result, $path); return $result; } diff --git a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeStream.php b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeStream.php index dd92edcbf5..c75afaa5f1 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeStream.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeStream.php @@ -61,7 +61,11 @@ class NativeStream implements File { } public function stream_close() { - return $this->state->close($this->handle); + try { + return $this->state->close($this->handle, $this->url); + } catch (\Exception $e) { + return false; + } } public function stream_eof() { @@ -110,7 +114,7 @@ class NativeStream implements File { } public function stream_write($data) { - return $this->state->write($this->handle, $data); + return $this->state->write($this->handle, $data, $this->url); } public function stream_truncate($size) { diff --git a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeWriteStream.php b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeWriteStream.php index 39eca8175a..4e90e5a655 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Native/NativeWriteStream.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Native/NativeWriteStream.php @@ -61,7 +61,7 @@ class NativeWriteStream extends NativeStream { private function flushWrite() { rewind($this->writeBuffer); - $this->state->write($this->handle, stream_get_contents($this->writeBuffer)); + $this->state->write($this->handle, stream_get_contents($this->writeBuffer), $this->url); $this->writeBuffer = fopen('php://memory', 'r+'); $this->bufferSize = 0; } @@ -79,8 +79,13 @@ class NativeWriteStream extends NativeStream { } public function stream_close() { - $this->flushWrite(); - return parent::stream_close(); + try { + $this->flushWrite(); + $flushResult = true; + } catch (\Exception $e) { + $flushResult = false; + } + return parent::stream_close() && $flushResult; } public function stream_tell() { diff --git a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php index 18ee5c1db9..e0df1f6032 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php @@ -14,11 +14,14 @@ use Icewind\SMB\Exception\DependencyException; use Icewind\SMB\Exception\FileInUseException; use Icewind\SMB\Exception\InvalidTypeException; use Icewind\SMB\Exception\NotFoundException; +use Icewind\SMB\Exception\InvalidRequestException; use Icewind\SMB\IFileInfo; use Icewind\SMB\INotifyHandler; use Icewind\SMB\IServer; use Icewind\SMB\ISystem; use Icewind\Streams\CallbackWrapper; +use Icewind\SMB\Native\NativeShare; +use Icewind\SMB\Native\NativeServer; class Share extends AbstractShare { /**