Browse Source

handle forbidden exceptions in smb backend

remotes/origin/users-ajaxloadgroups
Robin Appelman 10 years ago
parent
commit
edbe5d7b6d
  1. 19
      apps/files_external/lib/smb.php

19
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;
}
}

Loading…
Cancel
Save