Ensure that the shared folder symlink only exists if user has shared
folders
Closes
@@ -260,8 +260,10 @@ def configure_user(username, groups, uid=1000, gid=100):
# https://cwrap.org/nss_wrapper.html
f"echo '{etc_passwd}' > /tmp/passwd",
f"echo '{etc_group}' > /tmp/group",
- # mount the shared directories for user
- f"ln -sfn /shared /home/{username}/shared",
+ # mount the shared directories for user only if there are
+ # shared folders (groups) that the user is a member of
+ # else ensure that the `shared` folder symlink does not exist
+ f"ln -sfn /shared /home/{username}/shared" if groups else f"rm -f /home/{username}/shared",
# conda-store environment configuration
f"printf '{condarc}' > /home/{username}/.condarc",
# jupyter configuration
