diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-05-23 12:35:35 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-05-23 12:35:35 -0700 |
commit | e4bda1ac845991cb79e6f3ad21db1d54ee36ddd2 (patch) | |
tree | 729a71930514aa431f5d9ec0a688d3b942cd20bd | |
parent | d2970098841d61e027a7d51ef9f107707d275b6a (diff) | |
download | consfigurator-e4bda1ac845991cb79e6f3ad21db1d54ee36ddd2.tar.gz |
note that getent(1) is not strictly POSIX-compatible
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/property/user.lisp | 6 |
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))))) |