]> source.dussan.org Git - nextcloud-server.git/commitdiff
update icewind/smb to 3.4.1 26705/head
authorRobin Appelman <robin@icewind.nl>
Mon, 19 Apr 2021 14:00:47 +0000 (16:00 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 22 Apr 2021 18:01:54 +0000 (18:01 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_external/3rdparty/composer.json
apps/files_external/3rdparty/composer.lock
apps/files_external/3rdparty/composer/InstalledVersions.php
apps/files_external/3rdparty/composer/installed.json
apps/files_external/3rdparty/composer/installed.php
apps/files_external/3rdparty/icewind/smb/src/AnonymousAuth.php
apps/files_external/3rdparty/icewind/smb/src/KerberosAuth.php
apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php
apps/files_external/3rdparty/icewind/smb/src/Native/NativeStream.php
apps/files_external/3rdparty/icewind/smb/src/StringBuffer.php
apps/files_external/3rdparty/icewind/smb/src/Wrapped/Server.php

index 3f237c827eeaca7c67ab3de141b738d87c884852..b70bf2931ca14478a094feba3291251988c96067 100644 (file)
@@ -9,6 +9,6 @@
        },
        "require": {
                "icewind/streams": "0.7.3",
-               "icewind/smb": "3.4.0"
+               "icewind/smb": "3.4.1"
        }
 }
index 7e180c3366276a66b09e3a06e5b3e45a6e46dba9..98afd1332ed8446406a18b0052bf409f8bef351f 100644 (file)
@@ -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": "9905ed45527f669a4165a8b83b6e4141",
+    "content-hash": "dacbb67c9e2d1d46204d5b1a7f5cebc2",
     "packages": [
         {
             "name": "icewind/smb",
-            "version": "v3.4.0",
+            "version": "v3.4.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/icewind1991/SMB.git",
-                "reference": "b5c6921f2e91229c9f71556a4713b4fac91fd394"
+                "reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/icewind1991/SMB/zipball/b5c6921f2e91229c9f71556a4713b4fac91fd394",
-                "reference": "b5c6921f2e91229c9f71556a4713b4fac91fd394",
+                "url": "https://api.github.com/repos/icewind1991/SMB/zipball/9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
+                "reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
                 "shasum": ""
             },
             "require": {
@@ -49,9 +49,9 @@
             "description": "php wrapper for smbclient and libsmbclient-php",
             "support": {
                 "issues": "https://github.com/icewind1991/SMB/issues",
-                "source": "https://github.com/icewind1991/SMB/tree/v3.4.0"
+                "source": "https://github.com/icewind1991/SMB/tree/v3.4.1"
             },
-            "time": "2021-03-10T14:00:37+00:00"
+            "time": "2021-04-19T13:53:08+00:00"
         },
         {
             "name": "icewind/streams",
index 71cd811ef8dc9f4de2df0ddbb9d2a809e0f599ed..f28623ae66bb106cedb792f6dcda176991835e8d 100644 (file)
@@ -30,7 +30,7 @@ private static $installed = array (
     'aliases' => 
     array (
     ),
-    'reference' => '62929cc646134fbd409cfb4eacb7039d15763b96',
+    'reference' => '9a69b8839389f133db55a41e1c2ba4435fd50c19',
     'name' => 'files_external/3rdparty',
   ),
   'versions' => 
@@ -42,16 +42,16 @@ private static $installed = array (
       'aliases' => 
       array (
       ),
-      'reference' => '62929cc646134fbd409cfb4eacb7039d15763b96',
+      'reference' => '9a69b8839389f133db55a41e1c2ba4435fd50c19',
     ),
     'icewind/smb' => 
     array (
-      'pretty_version' => 'v3.4.0',
-      'version' => '3.4.0.0',
+      'pretty_version' => 'v3.4.1',
+      'version' => '3.4.1.0',
       'aliases' => 
       array (
       ),
-      'reference' => 'b5c6921f2e91229c9f71556a4713b4fac91fd394',
+      'reference' => '9dba42ab2a3990de29e18cc62b0a8270aceb74e3',
     ),
     'icewind/streams' => 
     array (
index e6950959c4fbb497371903ae5becf55868fa47de..8f7b949ab05fd2739b4ef8e66f032461d3ad5b58 100644 (file)
@@ -2,17 +2,17 @@
     "packages": [
         {
             "name": "icewind/smb",
-            "version": "v3.4.0",
-            "version_normalized": "3.4.0.0",
+            "version": "v3.4.1",
+            "version_normalized": "3.4.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/icewind1991/SMB.git",
-                "reference": "b5c6921f2e91229c9f71556a4713b4fac91fd394"
+                "reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/icewind1991/SMB/zipball/b5c6921f2e91229c9f71556a4713b4fac91fd394",
-                "reference": "b5c6921f2e91229c9f71556a4713b4fac91fd394",
+                "url": "https://api.github.com/repos/icewind1991/SMB/zipball/9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
+                "reference": "9dba42ab2a3990de29e18cc62b0a8270aceb74e3",
                 "shasum": ""
             },
             "require": {
@@ -25,7 +25,7 @@
                 "phpunit/phpunit": "^8.5|^9.3.8",
                 "psalm/phar": "^4.3"
             },
-            "time": "2021-03-10T14:00:37+00:00",
+            "time": "2021-04-19T13:53:08+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -46,7 +46,7 @@
             "description": "php wrapper for smbclient and libsmbclient-php",
             "support": {
                 "issues": "https://github.com/icewind1991/SMB/issues",
-                "source": "https://github.com/icewind1991/SMB/tree/v3.4.0"
+                "source": "https://github.com/icewind1991/SMB/tree/v3.4.1"
             },
             "install-path": "../icewind/smb"
         },
index 8d83406926dff44548344baa673fd68c77c7e706..17718bf45f224f1671a30f7fa2286cbd3bb36fe9 100644 (file)
@@ -6,7 +6,7 @@
     'aliases' => 
     array (
     ),
-    'reference' => '62929cc646134fbd409cfb4eacb7039d15763b96',
+    'reference' => '9a69b8839389f133db55a41e1c2ba4435fd50c19',
     'name' => 'files_external/3rdparty',
   ),
   'versions' => 
       'aliases' => 
       array (
       ),
-      'reference' => '62929cc646134fbd409cfb4eacb7039d15763b96',
+      'reference' => '9a69b8839389f133db55a41e1c2ba4435fd50c19',
     ),
     'icewind/smb' => 
     array (
-      'pretty_version' => 'v3.4.0',
-      'version' => '3.4.0.0',
+      'pretty_version' => 'v3.4.1',
+      'version' => '3.4.1.0',
       'aliases' => 
       array (
       ),
-      'reference' => 'b5c6921f2e91229c9f71556a4713b4fac91fd394',
+      'reference' => '9dba42ab2a3990de29e18cc62b0a8270aceb74e3',
     ),
     'icewind/streams' => 
     array (
index 0f3524002be04983c81fdaec6bc1a34d150d1520..302a249c8fa2316e0fe2ce441eb127ea519910cd 100644 (file)
@@ -21,6 +21,8 @@
 
 namespace Icewind\SMB;
 
+use Icewind\SMB\Exception\Exception;
+
 class AnonymousAuth implements IAuth {
        public function getUsername(): ?string {
                return null;
@@ -39,6 +41,8 @@ class AnonymousAuth implements IAuth {
        }
 
        public function setExtraSmbClientOptions($smbClientState): void {
-               smbclient_option_set($smbClientState, SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN, true);
+               if (smbclient_option_set($smbClientState, SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN, true) === false) {
+                       throw new Exception("Failed to set smbclient options for anonymous auth");
+               }
        }
 }
index 7cd9258465ad2a4f153e5de14eaa15f6045d1f1b..68fb74ff9abdc359d34f90c25fcb8b01cd8c5405 100644 (file)
@@ -21,6 +21,8 @@
 
 namespace Icewind\SMB;
 
+use Icewind\SMB\Exception\Exception;
+
 /**
  * Use existing kerberos ticket to authenticate
  */
@@ -42,7 +44,11 @@ class KerberosAuth implements IAuth {
        }
 
        public function setExtraSmbClientOptions($smbClientState): void {
-               smbclient_option_set($smbClientState, SMBCLIENT_OPT_USE_KERBEROS, true);
-               smbclient_option_set($smbClientState, SMBCLIENT_OPT_FALLBACK_AFTER_KERBEROS, false);
+               $success = (bool)smbclient_option_set($smbClientState, SMBCLIENT_OPT_USE_KERBEROS, true);
+               $success = $success && smbclient_option_set($smbClientState, SMBCLIENT_OPT_FALLBACK_AFTER_KERBEROS, false);
+
+               if (!$success) {
+                       throw new Exception("Failed to set smbclient options for kerberos auth");
+               }
        }
 }
index 10ba6ce04587292b47ca56b9a1999da2cb781230..e1a13ce3e72f7f0ffaa8e0271088d88eeffaf641 100644 (file)
@@ -97,14 +97,13 @@ class NativeState {
                /** @var resource $state */
                $state = smbclient_state_new();
                $this->state = $state;
+               /** @psalm-suppress UnusedFunctionCall */
                smbclient_option_set($this->state, SMBCLIENT_OPT_AUTO_ANONYMOUS_LOGIN, false);
+               /** @psalm-suppress UnusedFunctionCall */
                smbclient_option_set($this->state, SMBCLIENT_OPT_TIMEOUT, $options->getTimeout() * 1000);
 
                if (function_exists('smbclient_client_protocols')) {
-                       $maxProtocol = $options->getMaxProtocol();
-                       $minProtocol = $options->getMinProtocol();
-
-                       smbclient_client_protocols($this->state, $minProtocol, $maxProtocol);
+                       smbclient_client_protocols($this->state, $options->getMinProtocol(), $options->getMaxProtocol());
                }
 
                $auth->setExtraSmbClientOptions($this->state);
@@ -357,7 +356,9 @@ class NativeState {
 
        public function __destruct() {
                if ($this->connected) {
-                       smbclient_state_free($this->state);
+                       if (smbclient_state_free($this->state) === false) {
+                               throw new Exception("Failed to free smb state");
+                       }
                }
        }
 }
index 216c27f78e3e9620c1b7b60bf80866abc568cb46..624ef829d74bfa1d0f8479136f74a7e3be9f04d5 100644 (file)
@@ -52,7 +52,9 @@ abstract class NativeStream implements File {
         * @return resource
         */
        protected static function wrapClass(NativeState $state, $smbStream, string $mode, string $url, string $class) {
-               stream_wrapper_register('nativesmb', $class);
+               if (stream_wrapper_register('nativesmb', $class) === false) {
+                       throw new Exception("Failed to register stream wrapper");
+               }
                $context = stream_context_create([
                        'nativesmb' => [
                                'state'  => $state,
@@ -61,7 +63,9 @@ abstract class NativeStream implements File {
                        ]
                ]);
                $fh = fopen('nativesmb://', $mode, false, $context);
-               stream_wrapper_unregister('nativesmb');
+               if (stream_wrapper_unregister('nativesmb') === false) {
+                       throw new Exception("Failed to unregister stream wrapper");
+               }
                return $fh;
        }
 
index 856612187608dba494d03f394db6da1e55a8f9fb..c1963df4847a0b1d85d263aca0a312c8ecd07b8a 100644 (file)
@@ -44,7 +44,7 @@ class StringBuffer {
        }
 
        public function read(int $count): string {
-               $chunk = substr($this->buffer, $this->pos, $this->pos + $count);
+               $chunk = substr($this->buffer, $this->pos, $count);
                $this->pos += strlen($chunk);
                return $chunk;
        }
index 60cc9278dd9bfc658fa34588a96b9594e54ef716..dd8513eafd967af4a0fc8da145adeb2d0990942e 100644 (file)
@@ -88,7 +88,7 @@ class Server extends AbstractServer {
                $shareNames = $parser->parseListShares($output);
 
                $shares = [];
-               foreach ($shareNames as $name => $description) {
+               foreach ($shareNames as $name => $_description) {
                        $shares[] = $this->getShare($name);
                }
                return $shares;