Skip to content

Commit e869828

Browse files
authored
Merge pull request #7962 from nextcloud/smb-2.0.4-12
[12] update icewind/smb to 2.0.4
2 parents 8b8c796 + 4803bd1 commit e869828

File tree

11 files changed

+89
-61
lines changed

11 files changed

+89
-61
lines changed

apps/files_external/3rdparty/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"classmap-authoritative": true
99
},
1010
"require": {
11-
"icewind/smb": "2.0.3",
11+
"icewind/smb": "2.0.4",
1212
"icewind/streams": "0.5.2"
1313
}
1414
}

apps/files_external/3rdparty/composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files_external/3rdparty/composer/ClassLoader.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
class ClassLoader
4444
{
4545
// PSR-4
46-
private $firstCharsPsr4 = array();
47-
private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
46+
private $prefixLengthsPsr4 = array();
4847
private $prefixDirsPsr4 = array();
4948
private $fallbackDirsPsr4 = array();
5049

@@ -171,10 +170,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
171170
}
172171
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173172
// Register directories for a new namespace.
174-
if ('\\' !== substr($prefix, -1)) {
173+
$length = strlen($prefix);
174+
if ('\\' !== $prefix[$length - 1]) {
175175
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176176
}
177-
$this->firstCharsPsr4[$prefix[0]] = true;
177+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178178
$this->prefixDirsPsr4[$prefix] = (array) $paths;
179179
} elseif ($prepend) {
180180
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ public function setPsr4($prefix, $paths)
221221
if (!$prefix) {
222222
$this->fallbackDirsPsr4 = (array) $paths;
223223
} else {
224-
if ('\\' !== substr($prefix, -1)) {
224+
$length = strlen($prefix);
225+
if ('\\' !== $prefix[$length - 1]) {
225226
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226227
}
227-
$this->firstCharsPsr4[$prefix[0]] = true;
228+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228229
$this->prefixDirsPsr4[$prefix] = (array) $paths;
229230
}
230231
}
@@ -372,7 +373,7 @@ private function findFileWithExtension($class, $ext)
372373
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
373374

374375
$first = $class[0];
375-
if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
376+
if (isset($this->prefixLengthsPsr4[$first])) {
376377
$subPath = $class;
377378
while (false !== $lastPos = strrpos($subPath, '\\')) {
378379
$subPath = substr($subPath, 0, $lastPos);

apps/files_external/3rdparty/composer/autoload_classmap.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'Icewind\\SMB\\Exception\\FileInUseException' => $vendorDir . '/icewind/smb/src/Exception/FileInUseException.php',
2222
'Icewind\\SMB\\Exception\\ForbiddenException' => $vendorDir . '/icewind/smb/src/Exception/ForbiddenException.php',
2323
'Icewind\\SMB\\Exception\\HostDownException' => $vendorDir . '/icewind/smb/src/Exception/HostDownException.php',
24+
'Icewind\\SMB\\Exception\\InvalidArgumentException' => $vendorDir . '/icewind/smb/src/Exception/InvalidArgumentException.php',
2425
'Icewind\\SMB\\Exception\\InvalidHostException' => $vendorDir . '/icewind/smb/src/Exception/InvalidHostException.php',
2526
'Icewind\\SMB\\Exception\\InvalidParameterException' => $vendorDir . '/icewind/smb/src/Exception/InvalidParameterException.php',
2627
'Icewind\\SMB\\Exception\\InvalidPathException' => $vendorDir . '/icewind/smb/src/Exception/InvalidPathException.php',
@@ -51,13 +52,13 @@
5152
'Icewind\\SMB\\Server' => $vendorDir . '/icewind/smb/src/Server.php',
5253
'Icewind\\SMB\\Share' => $vendorDir . '/icewind/smb/src/Share.php',
5354
'Icewind\\SMB\\System' => $vendorDir . '/icewind/smb/src/System.php',
54-
'Icewind\\SMB\\Test\\AbstractShare' => $vendorDir . '/icewind/smb/tests/AbstractShare.php',
55-
'Icewind\\SMB\\Test\\NativeShare' => $vendorDir . '/icewind/smb/tests/NativeShare.php',
56-
'Icewind\\SMB\\Test\\NativeStream' => $vendorDir . '/icewind/smb/tests/NativeStream.php',
55+
'Icewind\\SMB\\Test\\AbstractShareTest' => $vendorDir . '/icewind/smb/tests/AbstractShareTest.php',
56+
'Icewind\\SMB\\Test\\NativeShareTestTest' => $vendorDir . '/icewind/smb/tests/NativeShareTestTest.php',
57+
'Icewind\\SMB\\Test\\NativeStreamTest' => $vendorDir . '/icewind/smb/tests/NativeStreamTest.php',
5758
'Icewind\\SMB\\Test\\NotifyHandlerTest' => $vendorDir . '/icewind/smb/tests/NotifyHandlerTest.php',
58-
'Icewind\\SMB\\Test\\Parser' => $vendorDir . '/icewind/smb/tests/Parser.php',
59-
'Icewind\\SMB\\Test\\Server' => $vendorDir . '/icewind/smb/tests/Server.php',
60-
'Icewind\\SMB\\Test\\Share' => $vendorDir . '/icewind/smb/tests/Share.php',
59+
'Icewind\\SMB\\Test\\ParserTest' => $vendorDir . '/icewind/smb/tests/ParserTest.php',
60+
'Icewind\\SMB\\Test\\ServerTest' => $vendorDir . '/icewind/smb/tests/ServerTest.php',
61+
'Icewind\\SMB\\Test\\ShareTestTest' => $vendorDir . '/icewind/smb/tests/ShareTestTest.php',
6162
'Icewind\\SMB\\Test\\TestCase' => $vendorDir . '/icewind/smb/tests/TestCase.php',
6263
'Icewind\\SMB\\TimeZoneProvider' => $vendorDir . '/icewind/smb/src/TimeZoneProvider.php',
6364
'Icewind\\Streams\\CallbackWrapper' => $vendorDir . '/icewind/streams/src/CallbackWrapper.php',

apps/files_external/3rdparty/composer/autoload_static.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66

77
class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
88
{
9-
public static $firstCharsPsr4 = array (
10-
'I' => true,
9+
public static $prefixLengthsPsr4 = array (
10+
'I' =>
11+
array (
12+
'Icewind\\Streams\\Tests\\' => 22,
13+
'Icewind\\Streams\\' => 16,
14+
'Icewind\\SMB\\Test\\' => 17,
15+
'Icewind\\SMB\\' => 12,
16+
),
1117
);
1218

1319
public static $prefixDirsPsr4 = array (
@@ -45,6 +51,7 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
4551
'Icewind\\SMB\\Exception\\FileInUseException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/FileInUseException.php',
4652
'Icewind\\SMB\\Exception\\ForbiddenException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/ForbiddenException.php',
4753
'Icewind\\SMB\\Exception\\HostDownException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/HostDownException.php',
54+
'Icewind\\SMB\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/InvalidArgumentException.php',
4855
'Icewind\\SMB\\Exception\\InvalidHostException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/InvalidHostException.php',
4956
'Icewind\\SMB\\Exception\\InvalidParameterException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/InvalidParameterException.php',
5057
'Icewind\\SMB\\Exception\\InvalidPathException' => __DIR__ . '/..' . '/icewind/smb/src/Exception/InvalidPathException.php',
@@ -75,13 +82,13 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
7582
'Icewind\\SMB\\Server' => __DIR__ . '/..' . '/icewind/smb/src/Server.php',
7683
'Icewind\\SMB\\Share' => __DIR__ . '/..' . '/icewind/smb/src/Share.php',
7784
'Icewind\\SMB\\System' => __DIR__ . '/..' . '/icewind/smb/src/System.php',
78-
'Icewind\\SMB\\Test\\AbstractShare' => __DIR__ . '/..' . '/icewind/smb/tests/AbstractShare.php',
79-
'Icewind\\SMB\\Test\\NativeShare' => __DIR__ . '/..' . '/icewind/smb/tests/NativeShare.php',
80-
'Icewind\\SMB\\Test\\NativeStream' => __DIR__ . '/..' . '/icewind/smb/tests/NativeStream.php',
85+
'Icewind\\SMB\\Test\\AbstractShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/AbstractShareTest.php',
86+
'Icewind\\SMB\\Test\\NativeShareTestTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeShareTestTest.php',
87+
'Icewind\\SMB\\Test\\NativeStreamTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeStreamTest.php',
8188
'Icewind\\SMB\\Test\\NotifyHandlerTest' => __DIR__ . '/..' . '/icewind/smb/tests/NotifyHandlerTest.php',
82-
'Icewind\\SMB\\Test\\Parser' => __DIR__ . '/..' . '/icewind/smb/tests/Parser.php',
83-
'Icewind\\SMB\\Test\\Server' => __DIR__ . '/..' . '/icewind/smb/tests/Server.php',
84-
'Icewind\\SMB\\Test\\Share' => __DIR__ . '/..' . '/icewind/smb/tests/Share.php',
89+
'Icewind\\SMB\\Test\\ParserTest' => __DIR__ . '/..' . '/icewind/smb/tests/ParserTest.php',
90+
'Icewind\\SMB\\Test\\ServerTest' => __DIR__ . '/..' . '/icewind/smb/tests/ServerTest.php',
91+
'Icewind\\SMB\\Test\\ShareTestTest' => __DIR__ . '/..' . '/icewind/smb/tests/ShareTestTest.php',
8592
'Icewind\\SMB\\Test\\TestCase' => __DIR__ . '/..' . '/icewind/smb/tests/TestCase.php',
8693
'Icewind\\SMB\\TimeZoneProvider' => __DIR__ . '/..' . '/icewind/smb/src/TimeZoneProvider.php',
8794
'Icewind\\Streams\\CallbackWrapper' => __DIR__ . '/..' . '/icewind/streams/src/CallbackWrapper.php',
@@ -117,7 +124,7 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
117124
public static function getInitializer(ClassLoader $loader)
118125
{
119126
return \Closure::bind(function () use ($loader) {
120-
$loader->firstCharsPsr4 = ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3::$firstCharsPsr4;
127+
$loader->prefixLengthsPsr4 = ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3::$prefixLengthsPsr4;
121128
$loader->prefixDirsPsr4 = ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3::$prefixDirsPsr4;
122129
$loader->classMap = ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3::$classMap;
123130

apps/files_external/3rdparty/composer/installed.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[
22
{
33
"name": "icewind/smb",
4-
"version": "v2.0.3",
5-
"version_normalized": "2.0.3.0",
4+
"version": "v2.0.4",
5+
"version_normalized": "2.0.4.0",
66
"source": {
77
"type": "git",
88
"url": "https://github.com/icewind1991/SMB.git",
9-
"reference": "8394551bf29a37b884edb33dae8acde369177f32"
9+
"reference": "f258947a6f840cc9655ba81744872f9bb292a7dd"
1010
},
1111
"dist": {
1212
"type": "zip",
13-
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/8394551bf29a37b884edb33dae8acde369177f32",
14-
"reference": "8394551bf29a37b884edb33dae8acde369177f32",
13+
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/f258947a6f840cc9655ba81744872f9bb292a7dd",
14+
"reference": "f258947a6f840cc9655ba81744872f9bb292a7dd",
1515
"shasum": ""
1616
},
1717
"require": {
@@ -21,7 +21,7 @@
2121
"require-dev": {
2222
"phpunit/phpunit": "^4.8"
2323
},
24-
"time": "2017-10-18T16:21:10+00:00",
24+
"time": "2018-01-19T14:36:36+00:00",
2525
"type": "library",
2626
"installation-source": "source",
2727
"autoload": {

apps/files_external/3rdparty/icewind/smb/src/AbstractShare.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ protected function verifyPath($path) {
2323
}
2424
}
2525
}
26+
27+
public function setForbiddenChars(array $charList) {
28+
$this->forbiddenCharacters = $charList;
29+
}
2630
}

apps/files_external/3rdparty/icewind/smb/src/Connection.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ public function write($input) {
3434
parent::write($input . PHP_EOL);
3535
}
3636

37+
public function clearTillPrompt() {
38+
$this->write('');
39+
do {
40+
$promptLine = $this->readLine();
41+
} while (!$this->isPrompt($promptLine));
42+
$this->write('');
43+
$this->readLine();
44+
}
45+
3746
/**
3847
* get all unprocessed output from smbclient until the next prompt
3948
*

0 commit comments

Comments
 (0)