diff options
author | Robin Appelman <robin@icewind.nl> | 2018-08-22 14:16:33 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-08-22 14:28:56 +0200 |
commit | 48f39628d0f4b32233575e79678f9c42bc010377 (patch) | |
tree | 8e332e6d23b157b3aa2c35389724a4f6c61108ce | |
parent | ff8626f46ec53f98c6e19c782cb225aa46c61099 (diff) | |
download | nextcloud-server-48f39628d0f4b32233575e79678f9c42bc010377.tar.gz nextcloud-server-48f39628d0f4b32233575e79678f9c42bc010377.zip |
use dir instead of allinfo where possible
-rw-r--r-- | apps/files_external/3rdparty/icewind/smb/src/Share.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Share.php index be1ba025508..23b28f16eda 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Share.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Share.php @@ -138,6 +138,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 |