diff options
-rw-r--r-- | lib/session.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/session.sh b/lib/session.sh index e745822..f0ec186 100644 --- a/lib/session.sh +++ b/lib/session.sh @@ -71,9 +71,10 @@ session_begin() # Register the session. mkdir "${session_root}/prokit/sessions/${session_id}" + mkdir "${session_root}/prokit/sessions/${session_id}/wd" profile_bind_mount "${session_arch}" "${session_plat}" \ "${session_mountdir}" \ - "${session_root}/prokit/sessions/${session_id}" + "${session_root}/prokit/sessions/${session_id}/wd" mutex_unlock "${session_root}/prokit/sessions.lock" } @@ -83,7 +84,8 @@ session_end() # Unregister the session. profile_bind_umount "${session_arch}" "${session_plat}" \ "${session_mountdir}" \ - "${session_root}/prokit/sessions/${session_id}" + "${session_root}/prokit/sessions/${session_id}/wd" + rmdir "${session_root}/prokit/sessions/${session_id}/wd" rmdir "${session_root}/prokit/sessions/${session_id}" if ! mutex_lock_timeout "${session_root}/prokit/sessions.lock" 5; then @@ -121,7 +123,7 @@ session_exec() arg="'$(printf '%s\n' "${arg}" | sed "s/'/'\\\\''/g")'" args="${args} ${arg}" done - session_dir="/prokit/sessions/${session_id}" + session_dir="/prokit/sessions/${session_id}/wd" chroot "${session_root}" /bin/sh -c "cd ${session_dir}; ${args}" } |