diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-04-01 18:19:47 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-04-01 18:32:31 -0700 |
commit | b6b26120f58e4d0b4bb884b44c7cc867cd90c8a0 (patch) | |
tree | 867b138c481bbfd42ea25db969e897a3c3624da6 /src/connection | |
parent | ed8c76f566de8f6c10cdace515b3d076026258f0 (diff) | |
download | consfigurator-b6b26120f58e4d0b4bb884b44c7cc867cd90c8a0.tar.gz |
connection chain specs.: consistently use :USER for the target user
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection')
-rw-r--r-- | src/connection/as.lisp | 4 | ||||
-rw-r--r-- | src/connection/linux-namespace.lisp | 2 | ||||
-rw-r--r-- | src/connection/setuid.lisp | 9 | ||||
-rw-r--r-- | src/connection/sudo.lisp | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/src/connection/as.lisp b/src/connection/as.lisp index 0a15cf8..a78f13f 100644 --- a/src/connection/as.lisp +++ b/src/connection/as.lisp @@ -23,7 +23,7 @@ (defun can-setuid () (zerop (nix:geteuid))) -(defmethod establish-connection ((type (eql :as)) remaining &key to) +(defmethod establish-connection ((type (eql :as)) remaining &key user) "Establish a :SETUID or :SU connection to another user account, depending on whether it is possible to establish a :SETUID connection. @@ -32,4 +32,4 @@ Note that both these connection types require root." ;; portable. (establish-connection (if (and (lisp-connection-p) (can-setuid)) :setuid :su) - remaining :to to)) + remaining :user user)) diff --git a/src/connection/linux-namespace.lisp b/src/connection/linux-namespace.lisp index c5c3809..e4a72ef 100644 --- a/src/connection/linux-namespace.lisp +++ b/src/connection/linux-namespace.lisp @@ -159,7 +159,7 @@ and will work but - ((:ssh :user \"root\") :sbcl (:setuid :to \"user\") (:lxc :name \"foo\")) + ((:ssh :user \"root\") :sbcl (:setuid :user \"user\") (:lxc :name \"foo\")) will not. See \"Dumping and reinvoking Lisp\" in the \"Pitfalls and limitations\" section of the Consfigurator manual. diff --git a/src/connection/setuid.lisp b/src/connection/setuid.lisp index 6fba4c2..f99e4b8 100644 --- a/src/connection/setuid.lisp +++ b/src/connection/setuid.lisp @@ -20,12 +20,13 @@ (defclass setuid-connection (rehome-connection fork-connection) ()) -(defmethod establish-connection ((type (eql :setuid)) remaining &key to) +(defmethod establish-connection ((type (eql :setuid)) remaining &key user) (unless (and (lisp-connection-p) (zerop (nix:geteuid))) (error "~&SETUIDing requires a Lisp image running as root")) - (informat 1 "~&SETUIDing to ~A" to) - (let* ((ent (or (osicat:user-info to) - (failed-change "~&Could not look up user info for ~A." to))) + (informat 1 "~&SETUIDing to ~A" user) + (let* ((ent + (or (osicat:user-info user) + (failed-change "~&Could not look up user info for ~A." user))) (xdg-cache-home (ensure-directory-pathname (stripln diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp index 486c8eb..8f3d238 100644 --- a/src/connection/sudo.lisp +++ b/src/connection/sudo.lisp @@ -25,9 +25,9 @@ ;; data to obtain passwords by following the conventions for having ;; prerequisite data sources provide them. -(defmethod preprocess-connection-args ((type (eql :sudo)) &key as (to "root")) +(defmethod preprocess-connection-args ((type (eql :sudo)) &key as (user "root")) (list :sudo - :user to + :user user :password (and as (destructuring-bind (user host) |