From c1389070fad5c84158d46ca784ba5e63af88d283 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 22 Aug 2018 14:16:33 +0200 Subject: [PATCH] use dir instead of allinfo where possible --- .../3rdparty/icewind/smb/src/Wrapped/Share.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php index ca88af219a..ce1c4b8577 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php @@ -153,6 +153,18 @@ class Share extends AbstractShare { * @return \Icewind\SMB\IFileInfo */ public function stat($path) { + // some windows server setups don't seem to like the allinfo command + // use the dir command instead to get the file info where possible + if ($path !== "" && $path !== "/") { + $parent = dirname($path); + $dir = $this->dir($parent); + $file = array_values(array_filter($dir, function(IFileInfo $info) use ($path) { + return $info->getPath() === $path; + })); + if ($file) { + return $file[0]; + } + } $escapedPath = $this->escapePath($path); $output = $this->execute('allinfo ' . $escapedPath); // Windows and non Windows Fileserver may respond different