Skip to content

Commit 47569c4

Browse files
committed
Ensure the user subdirectory has proper rights
1 parent 2d23aec commit 47569c4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tljh-plasma/tljh_plasma/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import grp
22
import os
33
import pwd
4+
import shutil
45

56
from dockerspawner import SystemUserSpawner
67
from jupyterhub.auth import PAMAuthenticator
@@ -59,6 +60,7 @@ async def start(self, *args, **kwargs):
5960
# create the user directory on the host if it does not exist
6061
volume_path = os.path.join(user_home, display_name)
6162
os.makedirs(volume_path, exist_ok=True)
63+
shutil.chown(volume_path, username, username)
6264

6365
# the escaped environment name is used to create a new folder in the user home directory
6466
home = os.path.abspath(os.path.join(user_home, os.path.pardir))

0 commit comments

Comments
 (0)