diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-04-10 14:36:37 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-04-10 14:59:16 +0200 |
commit | a41fbf7a92cbb194e22900fa2fa0d957f1d073cb (patch) | |
tree | 5d7fa87d96bd1bee018f056708e1911041cf8b23 /apps/files_external/3rdparty/icewind | |
parent | 75312f96d4727d8ec91a16c48ac0aca15405513f (diff) | |
download | nextcloud-server-a41fbf7a92cbb194e22900fa2fa0d957f1d073cb.tar.gz nextcloud-server-a41fbf7a92cbb194e22900fa2fa0d957f1d073cb.zip |
update icewind/smb to 1.0.0
Diffstat (limited to 'apps/files_external/3rdparty/icewind')
3 files changed, 23 insertions, 0 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Parser.php b/apps/files_external/3rdparty/icewind/smb/src/Parser.php index 381c4917a92..8b4de7825e4 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 926ce3714cf..15478511a72 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 025a84380a1..7c24f9f2e90 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); } |