Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private function getACL(IFileInfo $file): ?ACL {
try {
$acls = $file->getAcls();
} catch (Exception $e) {
$this->logger->error('Error while getting file acls', ['exception' => $e]);
$this->logger->warning('Error while getting file acls', ['exception' => $e]);
return null;
}
foreach ($acls as $user => $acl) {
Expand Down Expand Up @@ -426,6 +426,7 @@ public function fopen(string $path, string $mode) {
case 'r':
case 'rb':
if (!$this->file_exists($path)) {
$this->logger->warning('Failed to open ' . $path . ' on ' . $this->getId() . ', file doesn\'t exist.');
return false;
}
return $this->share->read($fullPath);
Expand Down Expand Up @@ -453,11 +454,13 @@ public function fopen(string $path, string $mode) {
}
if ($this->file_exists($path)) {
if (!$this->isUpdatable($path)) {
$this->logger->warning('Failed to open ' . $path . ' on ' . $this->getId() . ', file not updatable.');
return false;
}
$tmpFile = $this->getCachedFile($path);
} else {
if (!$this->isCreatable(dirname($path))) {
$this->logger->warning('Failed to open ' . $path . ' on ' . $this->getId() . ', parent directory not writable.');
return false;
}
$tmpFile = \OCP\Server::get(ITempManager::class)->getTemporaryFile($ext);
Expand All @@ -472,13 +475,16 @@ public function fopen(string $path, string $mode) {
}
return false;
} catch (NotFoundException $e) {
$this->logger->warning('Failed to open ' . $path . ' on ' . $this->getId() . ', not found.', ['exception' => $e]);
return false;
} catch (ForbiddenException $e) {
$this->logger->warning('Failed to open ' . $path . ' on ' . $this->getId() . ', forbidden.', ['exception' => $e]);
return false;
} catch (OutOfSpaceException $e) {
$this->logger->warning('Failed to open ' . $path . ' on ' . $this->getId() . ', out of space.', ['exception' => $e]);
throw new EntityTooLargeException('not enough available space to create file', 0, $e);
} catch (ConnectException $e) {
$this->logger->error('Error while opening file', ['exception' => $e]);
$this->logger->error('Error while opening file ' . $path . ' on ' . $this->getId(), ['exception' => $e]);
throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e);
}
}
Expand Down
Loading