diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-12 08:57:40 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-05 11:00:16 +0200 |
commit | f23390ed02b8573236eb392c00fb5806196be5e0 (patch) | |
tree | b90a3f82691f7c07a213928f1adfb2bfb933f716 /lib/private | |
parent | 3260f695905cdc20692f1c490ec9f8c2d28e872c (diff) | |
download | nextcloud-server-f23390ed02b8573236eb392c00fb5806196be5e0.tar.gz nextcloud-server-f23390ed02b8573236eb392c00fb5806196be5e0.zip |
Kill users with the reserved name on login
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/legacy/util.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index cb52949779f..b8f3a93ba50 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -311,10 +311,20 @@ class OC_Util { * * @param String $userId * @param \OCP\Files\Folder $userDirectory + * @throws \RuntimeException */ public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { - $skeletonDirectory = \OCP\Config::getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); + $skeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); + $instanceId = \OC::$server->getConfig()->getSystemValue('instanceid', ''); + + if ($instanceId === null) { + throw new \RuntimeException('no instance id!'); + } + $appdata = 'appdata_' . $instanceId; + if ($userId === $appdata) { + throw new \RuntimeException('username is reserved name: ' . $appdata); + } if (!empty($skeletonDirectory)) { \OCP\Util::writeLog( |