1
Fork 0

wip: comment out primary gid exception

main
Motiejus Jakštys 2022-07-15 09:29:42 +03:00
parent bd13e6a322
commit 4aee66fb11
1 changed files with 8 additions and 5 deletions

View File

@ -167,11 +167,14 @@ pub fn init(
for (groupmembers) |member_name| {
if (name2user.get(member_name)) |user_idx| {
// if user is in a group of their primary gid,
// skip the membersip.
if (users.items(.gid)[user_idx] == groups.items(.gid)[i])
continue;
// If user is in a group of their primary gid,
// skip the membersip. This is what classical tools do
// (look at your etc/passwd), but not what Ours Truly
// nss implementation does.
// - Uncomment this code to behave how Classics behave.
// - Leave commented to be compatible with Ours Truly NSS.
//if (users.items(.gid)[user_idx] == groups.items(.gid)[i])
// continue;
members.len += 1;
members[members.len - 1] = user_idx;
try user2groups[user_idx].append(allocator, @intCast(u32, i));