]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC: r361780, r361956
authorRick Macklem <rmacklem@FreeBSD.org>
Thu, 25 Jun 2020 02:45:49 +0000 (02:45 +0000)
committerRick Macklem <rmacklem@FreeBSD.org>
Thu, 25 Jun 2020 02:45:49 +0000 (02:45 +0000)
commit65dfb1889a6bec55cfd12bcae67aec472813aee0
tree14fe10f8eb0e4347318f6187b3a95feadddeb3e3
parent25cb5edfe050e59735d19969f9f675514c4ce182
MFC: r361780, r361956
Fix mountd to handle getgrouplist() not returning groups[0] == groups[1].

Prior to r174547, getgrouplist(3) always returned a groups list with
element 0 and 1 set to the basegid argument, so long as ngroups was > 1.
Post-r174547 this is not the case. r328304 disabled the deduplication that
removed the duplicate, but the duplicate still does not occur unless the
group for a user in the password database is also entered in the group
database.
This patch fixes mountd so that it handles the case where a user specified
with the -maproot or -mapall exports option has a getgrouplist(3) groups
list where groups[0] != groups[1].

Relnotes: yes
usr.sbin/mountd/mountd.c