diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-04-01 17:26:55 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-04-01 17:26:55 -0700 |
commit | 6d5c8b2d399a949fca10afcba88a1a5a68917221 (patch) | |
tree | 8d47b99f943a40514cb1a1d8d5c387ecdc71b9f9 /src/property | |
parent | 12fe8a3d803c952b6330544b23cc54945d5b3aa8 (diff) | |
download | consfigurator-6d5c8b2d399a949fca10afcba88a1a5a68917221.tar.gz |
rename PASSWD-ENTRY -> PASSWD-FIELD
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property')
-rw-r--r-- | src/property/lxc.lisp | 2 | ||||
-rw-r--r-- | src/property/user.lisp | 10 |
2 files changed, 6 insertions, 6 deletions
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." |