summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-02-10 16:41:58 +0100
committerRobin Appelman <icewind@owncloud.com>2016-02-10 16:52:13 +0100
commitedbe5d7b6d251bb104b8a5b23afeebb68ffc36fe (patch)
tree8cc2e03cde4e7ce61a140eb507c865ad13eb8110 /apps/files_external
parent9a2c517ca8eaf25bf142696e1479355112b1f108 (diff)
downloadnextcloud-server-edbe5d7b6d251bb104b8a5b23afeebb68ffc36fe.tar.gz
nextcloud-server-edbe5d7b6d251bb104b8a5b23afeebb68ffc36fe.zip
handle forbidden exceptions in smb backend
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/smb.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 50bd56f28ad..b93e6e5b805 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -30,6 +30,7 @@
namespace OC\Files\Storage;
use Icewind\SMB\Exception\Exception;
+use Icewind\SMB\Exception\ForbiddenException;
use Icewind\SMB\Exception\NotFoundException;
use Icewind\SMB\NativeServer;
use Icewind\SMB\Server;
@@ -159,6 +160,8 @@ class SMB extends Common {
}
} catch (NotFoundException $e) {
return false;
+ } catch (ForbiddenException $e) {
+ return false;
}
}
@@ -239,6 +242,8 @@ class SMB extends Common {
return false;
} catch (NotFoundException $e) {
return false;
+ } catch (ForbiddenException $e) {
+ return false;
}
}
@@ -257,6 +262,8 @@ class SMB extends Common {
return true;
} catch (NotFoundException $e) {
return false;
+ } catch (ForbiddenException $e) {
+ return false;
}
}
@@ -270,7 +277,13 @@ class SMB extends Common {
}
public function opendir($path) {
- $files = $this->getFolderContents($path);
+ try {
+ $files = $this->getFolderContents($path);
+ } catch (NotFoundException $e) {
+ return false;
+ } catch (ForbiddenException $e) {
+ return false;
+ }
$names = array_map(function ($info) {
/** @var \Icewind\SMB\IFileInfo $info */
return $info->getName();
@@ -283,6 +296,8 @@ class SMB extends Common {
return $this->getFileInfo($path)->isDirectory() ? 'dir' : 'file';
} catch (NotFoundException $e) {
return false;
+ } catch (ForbiddenException $e) {
+ return false;
}
}
@@ -302,6 +317,8 @@ class SMB extends Common {
return true;
} catch (NotFoundException $e) {
return false;
+ } catch (ForbiddenException $e) {
+ return false;
}
}