summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-12 16:09:05 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-12 16:09:05 +0100
commitad9dea8edf64c231c5ef3b201608431239f90beb (patch)
treef0f51c1dd78d735ec66d1c1c2d901d43dcb705ab /apps/files_external
parentb3323a51c9adbafbfaaafef839d0df0cdecb5d01 (diff)
parentedbe5d7b6d251bb104b8a5b23afeebb68ffc36fe (diff)
downloadnextcloud-server-ad9dea8edf64c231c5ef3b201608431239f90beb.tar.gz
nextcloud-server-ad9dea8edf64c231c5ef3b201608431239f90beb.zip
Merge pull request #22292 from owncloud/smb-handle-forbidden
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;
}
}