Skip to content

Commit

Permalink
Ensure the user subdirectory has proper rights
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Apr 7, 2022
1 parent 2d23aec commit 47569c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tljh-plasma/tljh_plasma/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import grp
import os
import pwd
import shutil

from dockerspawner import SystemUserSpawner
from jupyterhub.auth import PAMAuthenticator
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 47569c4

Please sign in to comment.