forked from shadow-maint/shadow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/, src/: Simplify allocation of buffer
getgroups(0, NULL) returns the number of groups, so that we can allocate at once. This might fail if there's a race and the number of users grows while we're allocating, but if that happens, failing is probably a good thing to do. There was some comment saying it doesn't work on some systems, but according to gnulib, that's only NeXTstep 3.2, which we don't support. Link: <https://www.gnu.org/software/gnulib/manual/html_node/getgroups.html> Reviewed-by: Serge Hallyn <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]>
- Loading branch information
1 parent
e048ba4
commit de941a7
Showing
2 changed files
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters