Raymond Toy pushed to branch issue-393-os-common-getpwuid at cmucl / cmucl
Commits:
-
af84aebc
by Raymond Toy at 2025-03-26T12:47:09-07:00
-
c94bf57a
by Raymond Toy at 2025-03-26T12:51:06-07:00
2 changed files:
Changes:
... | ... | @@ -2553,8 +2553,11 @@ |
2553 | 2553 | :password (string (cast (slot passwd 'pw-passwd) c-call:c-string))
|
2554 | 2554 | :uid (slot passwd 'pw-uid)
|
2555 | 2555 | :gid (slot passwd 'pw-gid)
|
2556 | - :gecos (string (cast (slot passwd 'pw-gecos) c-call:c-string))
|
|
2557 | - :dir (string (cast (slot passwd 'pw-dir) c-call:c-string))
|
|
2556 | + ;; The GECOS field could be unicode
|
|
2557 | + :gecos (string-decode (cast (slot passwd 'pw-gecos) c-call:c-string)
|
|
2558 | + :default)
|
|
2559 | + ;; The home directory could be unicode
|
|
2560 | + :dir (%file->name (cast (slot passwd 'pw-dir) c-call:c-string))
|
|
2558 | 2561 | :shell (string (cast (slot passwd 'pw-shell) c-call:c-string))))))
|
2559 | 2562 | (unless (null-alien result)
|
2560 | 2563 | (let ((passwd (deref result)))
|
... | ... | @@ -89,3 +89,10 @@ |
89 | 89 | (assert-true (and (integerp errno) (plusp errno)))))
|
90 | 90 | |
91 | 91 | |
92 | +(define-test getpwuid
|
|
93 | + (:tag :issues)
|
|
94 | + ;; Check that we get something sensible from unix-getpwuid.
|
|
95 | + (let ((info (unix:unix-getpwuid 0)))
|
|
96 | + (assert-true info)
|
|
97 | + (assert-equal (unix:user-info-name info)
|
|
98 | + "root"))) |