lix/src
Bernardo Meurer 931930feb1 fix(libstore/lock): support users that belong to more than 10 groups
The manpage for `getgrouplist` says:

> If the number of groups of which user is a member is less than or
> equal to *ngroups, then the value *ngroups is returned.
>
> If the user is a member of more than *ngroups groups, then
> getgrouplist() returns -1.  In this case, the value returned in
> *ngroups can be used to resize the buffer passed to a further
> call getgrouplist().

In our original code, however, we allocated a list of size `10` and, if
`getgrouplist` returned `-1` threw an exception. In practice, this
caused the code to fail for any user belonging to more than 10 groups.

While unusual for single-user systems, large companies commonly have a
huge number of POSIX groups users belong to, causing this issue to crop
up and make multi-user Nix unusable in such settings.

The fix is relatively simple, when `getgrouplist` fails, it stores the
real number of GIDs in `ngroups`, so we must resize our list and retry.
Only then, if it errors once more, we can raise an exception.

This should be backported to, at least, 2.9.x.
2022-06-08 13:45:41 -04:00
..
build-remote Generalize DerivationType in preparation for impure derivations 2022-03-18 14:59:56 +00:00
libcmd Respect the outputSpecified attribute 2022-05-30 11:34:47 +02:00
libexpr Shut up clang warnings 2022-06-02 21:19:54 +02:00
libfetchers Fix a segfault in the git fetcher 2022-05-27 16:15:28 +02:00
libmain Avoid fmt when constructor already does it 2022-04-19 01:44:11 +00:00
libstore fix(libstore/lock): support users that belong to more than 10 groups 2022-06-08 13:45:41 -04:00
libutil Fix incorrect comment in hiliteMatches 2022-06-05 20:30:18 +02:00
nix Fix missing ` in key manual 2022-06-08 11:46:50 +02:00
nix-build Stop the logger properly in legacy commands 2022-05-11 12:58:45 +02:00
nix-channel Fix segfault in headerCallback() 2022-03-03 11:11:16 +01:00
nix-collect-garbage Deduplicate the Store downcasting with a template 2022-03-11 13:32:33 +00:00
nix-copy-closure copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
nix-env Stop the logger properly in legacy commands 2022-05-11 12:58:45 +02:00
nix-instantiate store Symbols in a table as well, like positions 2022-04-21 21:56:31 +02:00
nix-store Stop the logger properly in legacy commands 2022-05-11 12:58:45 +02:00
resolve-system-dependencies Get rid of most .at calls (#6393) 2022-05-04 07:44:32 +02:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00