]> source.dussan.org Git - nextcloud-server.git/commitdiff
In cases where smb4php returns false of an empty array stat/( has to return false.
authorThomas Mueller <thomas.mueller@tmit.eu>
Fri, 31 May 2013 22:06:23 +0000 (00:06 +0200)
committerThomas Mueller <thomas.mueller@tmit.eu>
Fri, 31 May 2013 22:06:23 +0000 (00:06 +0200)
Fixes #3466 because the test method of external filesystems uses stat() to detect if the given parameters are okay.

Changes to 3rdparty are necessary as well:
https://github.com/owncloud/3rdparty/pull/33

apps/files_external/lib/smb.php

index 655c3c9a81653b1fafad3bee8c8e6ffb9d1e4129..81a6c95638591115d7740496e313571fb35bbcf6 100644 (file)
@@ -57,12 +57,22 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
 
        public function stat($path) {
                if ( ! $path and $this->root=='/') {//mtime doesn't work for shares
-                       $mtime=$this->shareMTime();
                        $stat=stat($this->constructUrl($path));
+                       if (empty($stat)) {
+                               return false;
+                       }
+                       $mtime=$this->shareMTime();
                        $stat['mtime']=$mtime;
                        return $stat;
                } else {
-                       return stat($this->constructUrl($path));
+                       $stat = stat($this->constructUrl($path));
+
+                       // smb4php can return an empty array if the connection could not be established
+                       if (empty($stat)) {
+                               return false;
+                       }
+
+                       return $stat;
                }
        }