aboutsummaryrefslogtreecommitdiff
path: root/src/property/user.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-04-01 17:26:55 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-04-01 17:26:55 -0700
commit6d5c8b2d399a949fca10afcba88a1a5a68917221 (patch)
tree8d47b99f943a40514cb1a1d8d5c387ecdc71b9f9 /src/property/user.lisp
parent12fe8a3d803c952b6330544b23cc54945d5b3aa8 (diff)
downloadconsfigurator-6d5c8b2d399a949fca10afcba88a1a5a68917221.tar.gz
rename PASSWD-ENTRY -> PASSWD-FIELD
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/user.lisp')
-rw-r--r--src/property/user.lisp10
1 files changed, 5 insertions, 5 deletions
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."