summaryrefslogtreecommitdiffstats
path: root/src/pwcache.c
AgeCommit message (Collapse)Author
2024-04-19Rename config.h to prelude.hTavian Barnes
2024-01-02pwcache: Fix uninitialized pointers on OpenBSDTavian Barnes
POSIX specifies that the get{pw,gr}*_r() functions store a NULL pointer to *result on error. However, OpenBSD does not always do this[1][2]: > if (bufsize < GETGR_R_SIZE_MAX) > return ERANGE; Work around it by explicitly initializing ret to NULL. [1]: https://github.com/openbsd/src/blob/e4829a9cc666f01ca5062d7fc15c20ab2d69229e/lib/libc/gen/getgrent.c#L135-L136 [2]: https://github.com/openbsd/src/blob/e4829a9cc666f01ca5062d7fc15c20ab2d69229e/lib/libc/gen/getgrent.c#L183-L184
2023-09-27Formatting fixesTavian Barnes
2023-08-31pwcache: Don't use _SC_GET{PW,GR}_R_SIZE_MAXTavian Barnes
They tend be 1024, which is a lot of memory per user/group. 128 is usually enough, so start there instead.
2023-08-31pwcache: Arena-allocate struct passwd/groupTavian Barnes
2023-06-20alloc: New header for memory allocation utilitiesTavian Barnes
2023-05-11config: Provide <stdalign.h> and <stdbool.h>Tavian Barnes
In anticipation of C23, since those headers won't be necessary any more.
2023-01-25Replace license boilerplate with SPDX tagsTavian Barnes
And while I'm at it, remove years from copyright declarations. Link: https://spdx.dev/about/ Link: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/
2022-11-09ctx: Flush the user/group caches when executing commandsTavian Barnes
This fixes (admittedly uncommon) commands like $ bfs -nouser -exec add-missing-user.sh {} \;
2022-11-09pwcache: Fill the user/group caches lazilyTavian Barnes
Iterating all the users/groups can be expensive, especially with NSS. Android has so many that it doesn't even return them all from get{pw,gr}ent() for performance reasons, leading to incorrect behaviour of -user/-group/etc.
2022-04-16Source / Include Folder (#88)トトも
Moved Source Files Into `src` Folder