From 6d5c8b2d399a949fca10afcba88a1a5a68917221 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 1 Apr 2022 17:26:55 -0700 Subject: rename PASSWD-ENTRY -> PASSWD-FIELD Signed-off-by: Sean Whitton --- doc/properties.rst | 2 +- src/connection/linux-namespace.lisp | 2 +- src/package.lisp | 2 +- src/property/lxc.lisp | 2 +- src/property/user.lisp | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/properties.rst b/doc/properties.rst index 3273da6..01a5919 100644 --- a/doc/properties.rst +++ b/doc/properties.rst @@ -113,4 +113,4 @@ Specification. Nevertheless, if a ``:posix`` property or function intended to be called by ``:posix`` properties uses non-POSIX facilities, but it is not obvious given the stated purpose of the property that it will do this, it is good to mention the use of non-POSIX facilities in the docstring. For -examples of this, see ``USER:HAS-LOGIN-SHELL`` and ``USER:PASSWD-ENTRY``. +examples of this, see ``USER:HAS-LOGIN-SHELL`` and ``USER:PASSWD-FIELD``. diff --git a/src/connection/linux-namespace.lisp b/src/connection/linux-namespace.lisp index 398cf63..c5c3809 100644 --- a/src/connection/linux-namespace.lisp +++ b/src/connection/linux-namespace.lisp @@ -114,7 +114,7 @@ (defmethod initialize-instance :after ((connection lxc-unpriv-attach-connection) &key) (with-slots (owner owner-uid) connection - (when owner (setf owner-uid (user:passwd-entry 2 owner))))) + (when owner (setf owner-uid (user:passwd-field 2 owner))))) (defmethod connection-shell-wrap ((connection lxc-unpriv-attach-connection) cmd) diff --git a/src/package.lisp b/src/package.lisp index 4d27970..8d2848d 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -554,7 +554,7 @@ #:has-login-shell #:has-enabled-password #:has-locked-password - #:passwd-entry)) + #:passwd-field)) (package :consfigurator.property.chroot (:local-nicknames (#:service #:consfigurator.property.service) diff --git a/src/property/lxc.lisp b/src/property/lxc.lisp index 3f9a29f..02575ae 100644 --- a/src/property/lxc.lisp +++ b/src/property/lxc.lisp @@ -309,7 +309,7 @@ implications." (let* ((runuser (and owner (not (string= owner (get-connattr :remote-user))))) (uid (if runuser - (user:passwd-entry 2 owner) + (user:passwd-field 2 owner) (get-connattr :remote-uid)))) (apply #'run :env `(:DBUS_SESSION_BUS_ADDRESS nil :XDG_RUNTIME_DIR ,(format nil "/run/user/~D" uid)) diff --git a/src/property/user.lisp b/src/property/user.lisp index f9f7f4d..6bc87d8 100644 --- a/src/property/user.lisp +++ b/src/property/user.lisp @@ -31,14 +31,14 @@ Note that this uses getent(1) and so is not strictly POSIX-compatible." (defprop %has-uid-gid :posix (username uid gid) (:check - (and (= uid (parse-integer (passwd-entry 2 username))) - (= gid (parse-integer (passwd-entry 3 username))) + (and (= uid (parse-integer (passwd-field 2 username))) + (= gid (parse-integer (passwd-field 3 username))) (= gid (parse-integer (group-entry 2 username))))) (:apply (let* ((gid-str (write-to-string gid)) (uid-str (write-to-string uid)) (uid+gid (format nil "~d:~d" uid gid)) - (home (passwd-entry 5 username))) + (home (passwd-field 5 username))) (mrun "groupmod" "--gid" gid-str username) (mrun "usermod" "--uid" uid-str "--gid" gid-str username) (mrun "chown" "-R" uid+gid home)))) @@ -88,7 +88,7 @@ the installation of other software." Note that this uses getent(1) and so is not strictly POSIX-compatible." (:desc #?"${username} has login shell ${shell}") (:check - (string= (passwd-entry 6 username) shell)) + (string= (passwd-field 6 username) shell)) (:apply (file:contains-lines "/etc/shells" shell) (mrun "chsh" "--shell" shell username))) @@ -127,7 +127,7 @@ and then this property will do nothing." (nth n (split-string (stripln (mrun "getent" database u)) :separator ":")))) -(defun passwd-entry (n username-or-uid) +(defun passwd-field (n username-or-uid) "Get the nth entry in the getent(1) output for USERNAME-OR-UID. Note that getent(1) is not specified in POSIX so use of this function makes properties not strictly POSIX-compatible." -- cgit v1.2.3