summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-05-05 14:44:51 +0200
committerRobin Appelman <robin@icewind.nl>2017-05-05 14:44:51 +0200
commit2b0da0f21888ecda6690cc99f290705320054bbc (patch)
tree045562d7f956534903581332f123c362d22b7a86 /lib
parent15f43b263507f381e66f475f3f63d105c5340cf5 (diff)
downloadnextcloud-server-2b0da0f21888ecda6690cc99f290705320054bbc.tar.gz
nextcloud-server-2b0da0f21888ecda6690cc99f290705320054bbc.zip
handle permissions errors when copying the skeleton for a read only user
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/User/Session.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index efa11348efe..ac0150ff611 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -46,6 +46,7 @@ use OC_User;
use OC_Util;
use OCA\DAV\Connector\Sabre\Auth;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\Files\NotPermittedException;
use OCP\IConfig;
use OCP\IRequest;
use OCP\ISession;
@@ -480,8 +481,12 @@ class Session implements IUserSession, Emitter {
//trigger creation of user home and /files folder
$userFolder = \OC::$server->getUserFolder($user);
- // copy skeleton
- \OC_Util::copySkeleton($user, $userFolder);
+ try {
+ // copy skeleton
+ \OC_Util::copySkeleton($user, $userFolder);
+ } catch (NotPermittedException $ex) {
+ // read only uses
+ }
// trigger any other initialization
\OC::$server->getEventDispatcher()->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser()));