changeset 589: |
16a3cdc06cbc |
parent: |
a0dfde3cb3c4
|
child: |
ebe3315b7add |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Mon, 12 Aug 2024 21:16:14 -0400 |
permissions: |
-rw-r--r-- |
description: |
add cli/tools/wg |
1 ;;; std/os.lisp --- OS interop definitions 9 (defun list-all-users () 10 "List all users via passwd. (uid gid name home shell comment)" 12 (sb-posix:do-passwds (u r) 13 (push (list (sb-posix:passwd-uid u) 14 (sb-posix:passwd-gid u) 15 (sb-posix:passwd-name u) 16 (sb-posix:passwd-dir u) 17 (sb-posix:passwd-shell u) 18 (sb-posix:passwd-gecos u)) 22 (defun list-all-groups () 23 "List all groups. (gid name mem)" 25 (sb-posix:do-groups (g r) (push (list (sb-posix:group-gid g) 26 (sb-posix:group-name g) 27 (sb-posix:group-mem g)) 30 (defmacro with-umask (mask &body body) 31 "Temporarily set the system-wide umask for the extent of BODY." 33 `(let ((,umask (sb-posix:umask ,mask))) 34 (unwind-protect (progn ,@body) 35 (sb-posix:umask ,umask))))) 37 ;; (with-umask #o22 nil)