diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-01 00:06:23 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-01 00:06:23 +0200 |
commit | 1d7d5d289401ad40e1a74737416193ae856a15bc (patch) | |
tree | d3574248942df42113b0a92c8ed64171cfec2ee3 /apps/files_external/lib/smb.php | |
parent | 698862519de6b364da6c20a97d8c546204e80f3d (diff) | |
download | nextcloud-server-1d7d5d289401ad40e1a74737416193ae856a15bc.tar.gz nextcloud-server-1d7d5d289401ad40e1a74737416193ae856a15bc.zip |
In cases where smb4php returns false of an empty array stat/( has to return false.
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
Diffstat (limited to 'apps/files_external/lib/smb.php')
-rw-r--r-- | apps/files_external/lib/smb.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 655c3c9a816..81a6c956385 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -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; } } |