summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-08-22 14:16:33 +0200
committerRobin Appelman <robin@icewind.nl>2018-08-22 14:28:56 +0200
commit48f39628d0f4b32233575e79678f9c42bc010377 (patch)
tree8e332e6d23b157b3aa2c35389724a4f6c61108ce
parentff8626f46ec53f98c6e19c782cb225aa46c61099 (diff)
downloadnextcloud-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.php12
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