Page MenuHomeFreeBSD

mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1
Needs ReviewPublic

Authored by olce on Fri, Oct 4, 8:10 AM.
Tags
None
Referenced Files
F98834610: D46921.id.diff
Fri, Oct 4, 10:17 PM
F98834599: D46921.id144219.diff
Fri, Oct 4, 10:17 PM
F98827571: D46921.diff
Fri, Oct 4, 9:48 PM
Subscribers

Details

Reviewers
rmacklem
Summary

Lift this unnecessary limitation.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59732
Build 56618: arc lint + arc unit

Event Timeline

olce requested review of this revision.Fri, Oct 4, 8:10 AM

Presumably this can be removed because getgrouplist will set ngroups at most NGROUPS_MAX, returning -1 if it would be too large (and ngroups was > NGROUPS_MAX on input). IMO we should replace this check with an assertion in that case as documentation.

usr.sbin/mountd/mountd.c
3653

Taking this out breaks the code. Note that ngroups is
set to NGROUPS_MAX + 1, so it is possible that it is
still NGROUPS_MAX+1.

If you are going to remove the code that takes out the
duplicate (that is another patch you presented and I will
comment on it there), then line#3648 should set

ngroups = NGROUPS_MAX

and

gid_t groups[NGROUPS_MAX];

However, this should only be done if the other patch
has been applied.