Merge pull request #22292 from owncloud/smb-handle-forbidden
handle forbidden exceptions in smb backend
This commit is contained in:
commit
ad9dea8edf
1 changed files with 18 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue