Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-02-24 13:08:04 +0300
committerJulius Härtl <jus@bitgrid.net>2019-03-01 22:57:01 +0300
commitc778032276808efdcc4dbdac94017419aaba57a0 (patch)
tree4c4eb3f4ce643068d7dd85a94a8e909e3b2fa732 /lib
parent6ee7286b419f77ae127257bbbf6a57415678076c (diff)
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')
-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'])) {