diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-27 16:10:28 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-27 16:10:28 -0700 |
commit | 745e5e4017d9c1947f669b508719afe30227fe5c (patch) | |
tree | f16bca2f6c60f03ae03b488dc18e0d5d711e1938 | |
parent | 07ce1bef0c06f22a0faef73ebe91569f189b1bc3 (diff) | |
download | consfigurator-745e5e4017d9c1947f669b508719afe30227fe5c.tar.gz |
:CHROOT.FORK: check for Lisp-type connection and root
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/connection/chroot/fork.lisp | 2 | ||||
-rw-r--r-- | src/package.lisp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/connection/chroot/fork.lisp b/src/connection/chroot/fork.lisp index 0983def..50dcbc9 100644 --- a/src/connection/chroot/fork.lisp +++ b/src/connection/chroot/fork.lisp @@ -25,6 +25,8 @@ #-(or sbcl) (foreign-funcall "chroot" :string path :int)) (defmethod establish-connection ((type (eql :chroot.fork)) remaining &key into) + (unless (and (lisp-connection-p) (zerop (foreign-funcall "geteuid" :int))) + (error "~&Forking into a chroot requires a Lisp image running as root")) (informat 1 "~&Forking into chroot at ~A" into) (with-fork-connection (remaining) (unless (zerop (chroot into)) diff --git a/src/package.lisp b/src/package.lisp index c2fa817..26d5ef8 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -341,7 +341,7 @@ (:use #:cl #:consfigurator #:consfigurator.connection.fork - #-(or sbcl) #:cffi)) + #:cffi)) (defpackage :consfigurator.connection.chroot.shell (:use #:cl |