From 47569c46387465c6fde651b277ac58efe9379370 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 29 Mar 2022 15:52:05 +0200 Subject: [PATCH] Ensure the user subdirectory has proper rights --- tljh-plasma/tljh_plasma/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tljh-plasma/tljh_plasma/__init__.py b/tljh-plasma/tljh_plasma/__init__.py index ff067bb..c3e7579 100644 --- a/tljh-plasma/tljh_plasma/__init__.py +++ b/tljh-plasma/tljh_plasma/__init__.py @@ -1,6 +1,7 @@ import grp import os import pwd +import shutil from dockerspawner import SystemUserSpawner from jupyterhub.auth import PAMAuthenticator @@ -59,6 +60,7 @@ async def start(self, *args, **kwargs): # create the user directory on the host if it does not exist volume_path = os.path.join(user_home, display_name) os.makedirs(volume_path, exist_ok=True) + shutil.chown(volume_path, username, username) # the escaped environment name is used to create a new folder in the user home directory home = os.path.abspath(os.path.join(user_home, os.path.pardir))