diff --git a/apps/files_external/3rdparty/.gitignore b/apps/files_external/3rdparty/.gitignore new file mode 100644 index 0000000000..a9a7266a62 --- /dev/null +++ b/apps/files_external/3rdparty/.gitignore @@ -0,0 +1 @@ +example.php diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json index b1315651c9..8992220d84 100644 --- a/apps/files_external/3rdparty/composer.json +++ b/apps/files_external/3rdparty/composer.json @@ -6,7 +6,7 @@ "vendor-dir": "." }, "require": { - "icewind/smb": "dev-master", + "icewind/smb": "1.0.0", "icewind/streams": "0.2" } } diff --git a/apps/files_external/3rdparty/composer.lock b/apps/files_external/3rdparty/composer.lock index 0a7dcf8987..ffd5c7c3c6 100644 --- a/apps/files_external/3rdparty/composer.lock +++ b/apps/files_external/3rdparty/composer.lock @@ -4,20 +4,20 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c854ee7f5bdcb3f2c8ee0a8cfe5e193a", + "hash": "2554253c9f91c67cd0db753a69105bc0", "packages": [ { "name": "icewind/smb", - "version": "dev-master", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/icewind1991/SMB.git", - "reference": "ef4b128143b7272e97665b84862d77faabf7d36d" + "reference": "4f5d9db3a9397e30476f92eb753751b54d6d4fa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SMB/zipball/ef4b128143b7272e97665b84862d77faabf7d36d", - "reference": "ef4b128143b7272e97665b84862d77faabf7d36d", + "url": "https://api.github.com/repos/icewind1991/SMB/zipball/4f5d9db3a9397e30476f92eb753751b54d6d4fa5", + "reference": "4f5d9db3a9397e30476f92eb753751b54d6d4fa5", "shasum": "" }, "require": { @@ -45,7 +45,7 @@ } ], "description": "php wrapper for smbclient and libsmbclient-php", - "time": "2015-03-13 12:17:14" + "time": "2015-04-10 12:10:08" }, { "name": "icewind/streams", @@ -91,9 +91,7 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "icewind/smb": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/apps/files_external/3rdparty/composer/installed.json b/apps/files_external/3rdparty/composer/installed.json index eae04e877d..441ed1f14f 100644 --- a/apps/files_external/3rdparty/composer/installed.json +++ b/apps/files_external/3rdparty/composer/installed.json @@ -43,17 +43,17 @@ }, { "name": "icewind/smb", - "version": "dev-master", - "version_normalized": "9999999-dev", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", "url": "https://github.com/icewind1991/SMB.git", - "reference": "ef4b128143b7272e97665b84862d77faabf7d36d" + "reference": "4f5d9db3a9397e30476f92eb753751b54d6d4fa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/SMB/zipball/ef4b128143b7272e97665b84862d77faabf7d36d", - "reference": "ef4b128143b7272e97665b84862d77faabf7d36d", + "url": "https://api.github.com/repos/icewind1991/SMB/zipball/4f5d9db3a9397e30476f92eb753751b54d6d4fa5", + "reference": "4f5d9db3a9397e30476f92eb753751b54d6d4fa5", "shasum": "" }, "require": { @@ -63,7 +63,7 @@ "require-dev": { "satooshi/php-coveralls": "dev-master" }, - "time": "2015-03-13 12:17:14", + "time": "2015-04-10 12:10:08", "type": "library", "installation-source": "source", "autoload": { diff --git a/apps/files_external/3rdparty/icewind/smb/src/Parser.php b/apps/files_external/3rdparty/icewind/smb/src/Parser.php index 381c4917a9..8b4de7825e 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Parser.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Parser.php @@ -92,6 +92,11 @@ class Parser { $size = 0; foreach ($output as $line) { list($name, $value) = explode(':', $line, 2); + // A line = explode statement may not fill all array elements + // properly. May happen when accessing non Windows Fileservers + $words = explode(':', $line, 2); + $name = isset($words[0]) ? $words[0] : ''; + $value = isset($words[1]) ? $words[1] : ''; $value = trim($value); if ($name === 'write_time') { $mtime = strtotime($value); diff --git a/apps/files_external/3rdparty/icewind/smb/src/RawConnection.php b/apps/files_external/3rdparty/icewind/smb/src/RawConnection.php index 926ce3714c..15478511a7 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/RawConnection.php +++ b/apps/files_external/3rdparty/icewind/smb/src/RawConnection.php @@ -149,6 +149,18 @@ class RawConnection { return; } if ($terminate) { + // if for case that posix_ functions are not available + if (function_exists('posix_kill')) { + $status = proc_get_status($this->process); + $ppid = $status['pid']; + $pids = preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`); + foreach($pids as $pid) { + if(is_numeric($pid)) { + //9 is the SIGKILL signal + posix_kill($pid, 9); + } + } + } proc_terminate($this->process); } proc_close($this->process); diff --git a/apps/files_external/3rdparty/icewind/smb/src/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Share.php index 025a84380a..7c24f9f2e9 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Share.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Share.php @@ -120,6 +120,12 @@ class Share implements IShare { public function stat($path) { $escapedPath = $this->escapePath($path); $output = $this->execute('allinfo ' . $escapedPath); + // Windows and non Windows Fileserver may respond different + // to the allinfo command for directories. If the result is a single + // line = error line, redo it with a different allinfo parameter + if ($escapedPath == '""' && count($output) < 2) { + $output = $this->execute('allinfo ' . '"."'); + } if (count($output) < 3) { $this->parseOutput($output, $path); }