aboutsummaryrefslogtreecommitdiff
path: root/src/property/user.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-23 12:35:35 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-23 12:35:35 -0700
commite4bda1ac845991cb79e6f3ad21db1d54ee36ddd2 (patch)
tree729a71930514aa431f5d9ec0a688d3b942cd20bd /src/property/user.lisp
parentd2970098841d61e027a7d51ef9f107707d275b6a (diff)
downloadconsfigurator-e4bda1ac845991cb79e6f3ad21db1d54ee36ddd2.tar.gz
note that getent(1) is not strictly POSIX-compatible
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/user.lisp')
-rw-r--r--src/property/user.lisp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/property/user.lisp b/src/property/user.lisp
index 705678c..416ab6a 100644
--- a/src/property/user.lisp
+++ b/src/property/user.lisp
@@ -29,7 +29,8 @@
(run "useradd" "-m" username)))
(defprop has-login-shell :posix (username shell)
- "Ensures that USERNAME has login shell SHELL."
+ "Ensures that USERNAME has login shell SHELL.
+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))
@@ -38,6 +39,9 @@
(mrun "chsh" "--shell" shell username)))
(defun passwd-entry (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."
(let ((u (etypecase username-or-uid
(string username-or-uid)
(number (write-to-string username-or-uid)))))