Skip to content

Commit

Permalink
Create new FileInfo with aclCallback that returns an empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Apr 14, 2020
1 parent dee3785 commit ec12548
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,16 @@ protected function getFileInfo($path) {
} else {
$mode = IFileInfo::MODE_DIRECTORY;
}
$this->statCache[$path] = new FileInfo($path, '', 0, $this->statCache[$path]->getMTime(), $mode);
$this->statCache[$path] = new FileInfo(
$path,
'',
0,
$this->statCache[$path]->getMTime(),
$mode,
function () {
return [];
}
);
}
} catch (ConnectException $e) {
$ex = new StorageNotAvailableException(
Expand All @@ -180,7 +189,16 @@ protected function getFileInfo($path) {
} catch (ForbiddenException $e) {
if ($this->remoteIsShare() && $this->isRootDir($path)) { //mtime may not work for share root
$this->log("faking stat for forbidden '$path'");
$this->statCache[$path] = new FileInfo($path, '', 0, $this->shareMTime(), IFileInfo::MODE_DIRECTORY);
$this->statCache[$path] = new FileInfo(
$path,
'',
0,
$this->shareMTime(),
IFileInfo::MODE_DIRECTORY,
function () {
return [];
}
);
} else {
$this->leave(__FUNCTION__, $e);
throw $e;
Expand Down

0 comments on commit ec12548

Please sign in to comment.