Raymond Toy pushed to branch issue-408-get-user-name-and-homedir at cmucl / cmucl
Commits:
-
8dd89bb8
by Raymond Toy at 2025-06-27T13:56:04-07:00
1 changed file:
Changes:
| ... | ... | @@ -788,7 +788,8 @@ again: |
| 788 | 788 | |
| 789 | 789 | /*
|
| 790 | 790 | * Given the UID, return the user name. If the uid does not exist,
|
| 791 | - * returns NULL.
|
|
| 791 | + * returns NULL. The caller must call free on the string that is
|
|
| 792 | + * returned.
|
|
| 792 | 793 | */
|
| 793 | 794 | char *
|
| 794 | 795 | os_get_username(uid_t uid)
|
| ... | ... | @@ -970,6 +971,13 @@ get_homedir_from_name(const char* name, int *status) |
| 970 | 971 | return NULL;
|
| 971 | 972 | }
|
| 972 | 973 | |
| 974 | +/*
|
|
| 975 | + * Return the home directory for the given UID. If the home directory
|
|
| 976 | + * does not exist, NULL is returned. STATUS is set to 0 if the home
|
|
| 977 | + * directory could be found. Otherwise, it is the errno.
|
|
| 978 | + *
|
|
| 979 | + * The caller must free the memory returned.
|
|
| 980 | + */
|
|
| 973 | 981 | static char *
|
| 974 | 982 | get_homedir_from_uid(uid_t uid, int *status)
|
| 975 | 983 | {
|
| ... | ... | @@ -991,6 +999,8 @@ get_homedir_from_uid(uid_t uid, int *status) |
| 991 | 999 | * home directory cannot be determined for any reason. The parameter
|
| 992 | 1000 | * STATUS is 0 if the home directory could be determined. Otherwise
|
| 993 | 1001 | * it is the errno value.
|
| 1002 | + *
|
|
| 1003 | + * The caller must free the memory returned for the result.
|
|
| 994 | 1004 | */
|
| 995 | 1005 | char *
|
| 996 | 1006 | os_get_user_homedir(const char* name, int *status)
|