aboutsummaryrefslogtreecommitdiff
path: root/src/connection
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-19 10:41:04 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-19 10:41:04 -0700
commitb79d04778cd98026370336dce955d668a5ef8395 (patch)
tree59cb09bfb1d702a7cfc4f4bc8e80a60d59d17c65 /src/connection
parentffd392b3c41c1f518ba3b404998683526080ada2 (diff)
downloadconsfigurator-b79d04778cd98026370336dce955d668a5ef8395.tar.gz
chdir after chrooting
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection')
-rw-r--r--src/connection/chroot/fork.lisp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/connection/chroot/fork.lisp b/src/connection/chroot/fork.lisp
index c6d6499..ab4ab72 100644
--- a/src/connection/chroot/fork.lisp
+++ b/src/connection/chroot/fork.lisp
@@ -62,6 +62,9 @@
(list *standard-input* *debug-io* *terminal-io*))
(unless (zerop (chroot into))
(error "chroot(2) failed; are you root?"))
+ ;; chdir, else our current working directory is a pointer to
+ ;; something outside the chroot
+ (uiop:chdir "/")
;; it would be nice to reenter Consfigurator's primary loop by
;; just calling (return-from establish-connection
;; (establish-connection :local)) here, but we need to kill off