|
|
|
|
@ -196,7 +196,7 @@ class SMB extends Common implements INotifyStorage { |
|
|
|
|
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) { |
|
|
|
|
@ -424,6 +424,7 @@ class SMB extends Common implements INotifyStorage { |
|
|
|
|
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); |
|
|
|
|
@ -451,11 +452,13 @@ class SMB extends Common implements INotifyStorage { |
|
|
|
|
} |
|
|
|
|
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 = \OC::$server->getTempManager()->getTemporaryFile($ext); |
|
|
|
|
@ -470,13 +473,16 @@ class SMB extends Common implements INotifyStorage { |
|
|
|
|
} |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|