diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-04-22 11:10:51 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-04-22 11:46:33 +0200 |
commit | 085bcd7da27e82e4695ff1a2cf961e9b6a820712 (patch) | |
tree | 5e48184447e84ede4197fb19181bb54b430400a2 /lib/private | |
parent | 7be1094ba5bdfedb15489b45ed4f561b2590fe6a (diff) | |
download | nextcloud-server-085bcd7da27e82e4695ff1a2cf961e9b6a820712.tar.gz nextcloud-server-085bcd7da27e82e4695ff1a2cf961e9b6a820712.zip |
Throw NoUserException when attempting to init mount point for null user
In some scenarios initMountPoints is called with an empty user, and
also there is no user in the session.
In such cases, it is unsafe to let the code move on with an empty user.
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/filesystem.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index a9138b0d2d7..ec9b537a358 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -372,6 +372,9 @@ class Filesystem { if ($user == '') { $user = \OC_User::getUser(); } + if ($user === null || $user === false || $user === '') { + throw new \OC\User\NoUserException('Attempted to initialize mount points for null user and no user in session'); + } if (isset(self::$usersSetup[$user])) { return; } |