diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-02-10 18:41:58 +0300 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-03-22 17:37:21 +0300 |
commit | 2b36716b18f186b9c068cb1ff5ebdce2e77202eb (patch) | |
tree | c3d15d7706ebf089413b3e6633e5ca054df4ee7f /apps | |
parent | d0ad124505946f0ffd94c7eb374265e7e535539d (diff) |
handle forbidden exceptions in smb backend
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/smb.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 3db25d477dd..fee34692a02 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; } } @@ -235,6 +238,8 @@ class SMB extends Common { return false; } catch (NotFoundException $e) { return false; + } catch (ForbiddenException $e) { + return false; } } @@ -253,6 +258,8 @@ class SMB extends Common { return true; } catch (NotFoundException $e) { return false; + } catch (ForbiddenException $e) { + return false; } } @@ -266,7 +273,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(); @@ -279,6 +292,8 @@ class SMB extends Common { return $this->getFileInfo($path)->isDirectory() ? 'dir' : 'file'; } catch (NotFoundException $e) { return false; + } catch (ForbiddenException $e) { + return false; } } @@ -298,6 +313,8 @@ class SMB extends Common { return true; } catch (NotFoundException $e) { return false; + } catch (ForbiddenException $e) { + return false; } } |