Skip to content

Commit

Permalink
update icewind/smb to 3.5.3
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed May 27, 2022
1 parent ac79137 commit 05a63c0
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 40 deletions.
5 changes: 5 additions & 0 deletions apps/files_external/3rdparty/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit98fe9b281934250b3a93f69a5ce843b3::getLoader();
2 changes: 1 addition & 1 deletion apps/files_external/3rdparty/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"require": {
"icewind/streams": "0.7.4",
"icewind/smb": "3.5.2"
"icewind/smb": "3.5.3"
}
}
16 changes: 8 additions & 8 deletions apps/files_external/3rdparty/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/files_external/3rdparty/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = $vendorDir;

return array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = $vendorDir;

return array(
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/3rdparty/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = $vendorDir;

return array(
Expand Down
15 changes: 3 additions & 12 deletions apps/files_external/3rdparty/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,11 @@ public static function getLoader()
require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit98fe9b281934250b3a93f69a5ce843b3', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit98fe9b281934250b3a93f69a5ce843b3', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);
Expand Down
14 changes: 7 additions & 7 deletions apps/files_external/3rdparty/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"packages": [
{
"name": "icewind/smb",
"version": "v3.5.2",
"version_normalized": "3.5.2.0",
"version": "v3.5.3",
"version_normalized": "3.5.3.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "0a425bd21acf7ae112b135dca34640e1b1a825c3"
"reference": "3e25d3116111064ec45a0e1b351fc4baf396ca43"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/0a425bd21acf7ae112b135dca34640e1b1a825c3",
"reference": "0a425bd21acf7ae112b135dca34640e1b1a825c3",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/3e25d3116111064ec45a0e1b351fc4baf396ca43",
"reference": "3e25d3116111064ec45a0e1b351fc4baf396ca43",
"shasum": ""
},
"require": {
Expand All @@ -25,7 +25,7 @@
"phpunit/phpunit": "^8.5|^9.3.8",
"psalm/phar": "^4.3"
},
"time": "2022-01-20T14:51:51+00:00",
"time": "2022-05-27T15:00:33+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -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.5.2"
"source": "https://github.com/icewind1991/SMB/tree/v3.5.3"
},
"install-path": "../icewind/smb"
},
Expand Down
10 changes: 5 additions & 5 deletions apps/files_external/3rdparty/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => '0bed61f949bc7a8c69cd154919e78b704e28c99e',
'reference' => 'ac79137816709b4adc6b2e21cc52c807381c4baf',
'name' => 'files_external/3rdparty',
'dev' => true,
),
Expand All @@ -16,16 +16,16 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => '0bed61f949bc7a8c69cd154919e78b704e28c99e',
'reference' => 'ac79137816709b4adc6b2e21cc52c807381c4baf',
'dev_requirement' => false,
),
'icewind/smb' => array(
'pretty_version' => 'v3.5.2',
'version' => '3.5.2.0',
'pretty_version' => 'v3.5.3',
'version' => '3.5.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../icewind/smb',
'aliases' => array(),
'reference' => '0a425bd21acf7ae112b135dca34640e1b1a825c3',
'reference' => '3e25d3116111064ec45a0e1b351fc4baf396ca43',
'dev_requirement' => false,
),
'icewind/streams' => array(
Expand Down
9 changes: 8 additions & 1 deletion apps/files_external/3rdparty/icewind/smb/src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ protected function getBinaryPath(string $binary): ?string {
$result = null;
$output = [];
exec("which $binary 2>&1", $output, $result);
$this->paths[$binary] = $result === 0 && isset($output[0]) ? (string)$output[0] : null;

if ($result === 0 && isset($output[0])) {
$this->paths[$binary] = (string)$output[0];
} else if (is_executable("/usr/bin/$binary")) {
$this->paths[$binary] = "/usr/bin/$binary";
} else {
$this->paths[$binary] = null;
}
}
return $this->paths[$binary];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private function unknownError($promptLine = '') {
} else {
$error = $this->readError(); // maybe something on stderr
if ($error) {
throw new ConnectException('Unknown error (' . $error . ')');
throw new ConnectException('Unknown error (stderr: ' . $error . ')');
} else {
throw new ConnectException('Unknown error');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ public function parseStat(array $output): array {
public function parseDir(array $output, string $basePath, callable $aclCallback): array {
//last line is used space
array_pop($output);
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARS]*)\s+)?([0-9]+)\s+(.*)$/';
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARSCndharsc]*)\s+)?([0-9]+)\s+(.*)$/';
//2 spaces, filename, optional type, size, date
$content = [];
foreach ($output as $line) {
if (preg_match($regex, $line, $matches)) {
list(, $name, $mode, $size, $time) = $matches;
if ($name !== '.' and $name !== '..') {
$mode = $this->parseMode($mode);
$mode = $this->parseMode(strtoupper($mode));
$time = strtotime($time . ' ' . $this->timeZone);
$path = $basePath . '/' . $name;
$content[] = new FileInfo($path, $name, (int)$size, $time, $mode, function () use ($aclCallback, $path): array {
Expand Down

0 comments on commit 05a63c0

Please sign in to comment.