diff options
Diffstat (limited to 'src/property/user.lisp')
-rw-r--r-- | src/property/user.lisp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/property/user.lisp b/src/property/user.lisp index c96af2a..705678c 100644 --- a/src/property/user.lisp +++ b/src/property/user.lisp @@ -37,9 +37,12 @@ (file:contains-lines "/etc/shells" shell) (mrun "chsh" "--shell" shell username))) -(defun passwd-entry (n username) - (nth n (split-string (stripln (run "getent" "passwd" username)) - :separator ":"))) +(defun passwd-entry (n username-or-uid) + (let ((u (etypecase username-or-uid + (string username-or-uid) + (number (write-to-string username-or-uid))))) + (nth n (split-string (stripln (mrun "getent" "passwd" u)) + :separator ":")))) (defun user-exists (username) (zerop (run :for-exit "getent" "passwd" username))) |