diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 12c2d99338d1..68bfc0b4f0ca 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -131,6 +131,14 @@ 'message' => $l->t('Storage invalid') ) )); +} catch (\OCP\Files\NotPermittedException $e) { + \OCP\Util::logException('files', $e); + OCP\JSON::error(array( + 'data' => array( + 'exception' => '\OCP\Files\NotPermittedException', + 'message' => $l->t('Permission denied accessing the resource or temporary storage error') + ) + )); } catch (\Exception $e) { \OCP\Util::logException('files', $e); OCP\JSON::error(array( diff --git a/lib/private/files/objectstore/eosutil.php b/lib/private/files/objectstore/eosutil.php index 182e0d07b3d0..98da18e2f94c 100644 --- a/lib/private/files/objectstore/eosutil.php +++ b/lib/private/files/objectstore/eosutil.php @@ -1058,7 +1058,8 @@ public static function getFolderContents($eosPath, $additionalParameterCallback $files = array(); list($result, $errcode) = EosCmd::exec($getFolderContents); if ($errcode !== 0) { - return $files; + // Safe bet: always throw permission denied if the call to eos fails. + throw new \OCP\Files\NotPermittedException("cannot list contents of eos folder"); } // we need to obtain the tree size performing an 'ls' command and merging attributes