summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-02-24 11:08:04 +0100
committerJulius Härtl <jus@bitgrid.net>2019-03-01 20:57:01 +0100
commitc778032276808efdcc4dbdac94017419aaba57a0 (patch)
tree4c4eb3f4ce643068d7dd85a94a8e909e3b2fa732 /lib/private
parent6ee7286b419f77ae127257bbbf6a57415678076c (diff)
downloadnextcloud-server-c778032276808efdcc4dbdac94017419aaba57a0.tar.gz
nextcloud-server-c778032276808efdcc4dbdac94017419aaba57a0.zip
Properly handle null as ownerId if file system access is denied by access token
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/View.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index f12e4609e08..10fbf00e73c 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1381,8 +1381,12 @@ class View {
if ($mount instanceof MoveableMount && $internalPath === '') {
$data['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
}
-
- $owner = $this->getUserObjectForOwner($storage->getOwner($internalPath));
+ $ownerId = $storage->getOwner($internalPath);
+ $owner = null;
+ if ($ownerId !== null) {
+ // ownerId might be null if files are accessed with an access token without file system access
+ $owner = $this->getUserObjectForOwner($ownerId);
+ }
$info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner);
if ($data and isset($data['fileid'])) {