From 4b00c1a9ead9851275e5930fe65e3d9bfd563a24 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 13 Apr 2022 17:30:01 -0700 Subject: REHOME-CONNECTION: rename slot DATADIR -> REHOME-DATADIR Signed-off-by: Sean Whitton --- src/connection/chroot.lisp | 4 ++-- src/connection/rehome.lisp | 14 ++++++++------ src/connection/setuid.lisp | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src/connection') diff --git a/src/connection/chroot.lisp b/src/connection/chroot.lisp index b681e48..e40d7ca 100644 --- a/src/connection/chroot.lisp +++ b/src/connection/chroot.lisp @@ -109,10 +109,10 @@ should be the mount point, without the chroot's root prefixed.") ;; ensure they don't get bogus values when this connection object is used ;; in UPLOAD-ALL-PREREQUISITE-DATA. (connection-connattr connection :remote-home) - ;; Obtain & cache XDG_CACHE_HOME inside the chroot, and compute DATADIR. + ;; Cache XDG_CACHE_HOME inside the chroot, and compute REHOME-DATADIR. (let ((xdg-cache-home (connection-connattr connection :XDG_CACHE_HOME))) (setf connection (change-class connection 'chroot.fork-connection) - (slot-value connection 'datadir) + (slot-value connection 'rehome-datadir) (merge-pathnames "consfigurator/data/" (chroot-pathname xdg-cache-home into)))) (continue-connection connection remaining))) diff --git a/src/connection/rehome.lisp b/src/connection/rehome.lisp index ecb2816..5ceb103 100644 --- a/src/connection/rehome.lisp +++ b/src/connection/rehome.lisp @@ -19,8 +19,8 @@ (named-readtables:in-readtable :consfigurator) (defclass rehome-connection () - ((datadir - :type :string :initarg :datadir :reader datadir + ((rehome-datadir + :type :string :initarg :rehome-datadir :reader rehome-datadir :documentation "Where Consfigurator would cache items of prerequisite data in the new HOME, as accessible from the previous connection hop. @@ -36,8 +36,9 @@ to a directory inside the chroot as seen from outside the chroot.")) (defmethod connection-upload ((connection rehome-connection) (data file-data)) (with-slots (data-iden1 data-iden2 data-version) data - (let ((inside (data-pathname - (datadir connection) data-iden1 data-iden2 data-version)) + (let ((inside + (data-pathname + (rehome-datadir connection) data-iden1 data-iden2 data-version)) (outside (remote-data-pathname data-iden1 data-iden2 data-version))) (mrun "mkdir" "-p" (pathname-directory-pathname inside)) (if (remote-exists-p outside) @@ -52,8 +53,9 @@ to a directory inside the chroot as seen from outside the chroot.")) (defmethod connection-clear-data-cache ((connection rehome-connection) iden1 iden2) - (delete-remote-trees (data-pathname (datadir connection) iden1 iden2))) + (delete-remote-trees + (data-pathname (rehome-datadir connection) iden1 iden2))) (defmethod get-remote-cached-prerequisite-data ((connection rehome-connection)) - (get-local-cached-prerequisite-data (datadir connection))) + (get-local-cached-prerequisite-data (rehome-datadir connection))) diff --git a/src/connection/setuid.lisp b/src/connection/setuid.lisp index f99e4b8..fda100f 100644 --- a/src/connection/setuid.lisp +++ b/src/connection/setuid.lisp @@ -45,7 +45,7 @@ (continue-connection (make-instance 'setuid-connection - :datadir datadir + :rehome-datadir datadir :connattrs `(:remote-uid ,(cdr (assoc :user-id ent)) :remote-gid ,(cdr (assoc :group-id ent)) :remote-user ,(cdr (assoc :name ent)) @@ -59,9 +59,10 @@ (let ((uid (connection-connattr connection :remote-uid)) (gid (connection-connattr connection :remote-gid)) (user (connection-connattr connection :remote-user))) - (run-program (list "chown" "-R" - (format nil "~A:~A" uid gid) - (unix-namestring (slot-value connection 'datadir)))) + (run-program + (list "chown" "-R" + (format nil "~A:~A" uid gid) + (unix-namestring (slot-value connection 'rehome-datadir)))) (posix-login-environment uid user (connection-connattr connection :remote-home)) ;; We are privileged, so this sets the real, effective and saved IDs. -- cgit v1.2.3