Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-02-10 18:41:58 +0300
committerRobin Appelman <icewind@owncloud.com>2016-03-22 17:37:21 +0300
commit2b36716b18f186b9c068cb1ff5ebdce2e77202eb (patch)
treec3d15d7706ebf089413b3e6633e5ca054df4ee7f /apps
parentd0ad124505946f0ffd94c7eb374265e7e535539d (diff)
handle forbidden exceptions in smb backend
Diffstat (limited to 'apps')
-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 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;
}
}