HomeFreeBSD

nfsd: Fix handling of credentials with cr_ngroups == 0

Description

nfsd: Fix handling of credentials with cr_ngroups == 0

There has been a documented case in the exports(5) man
page forever, which specifies that the -maproot or -mapall
may have a single user entry, followed by a ':'.
This case is defined as specifying no groups (aka cr_ngroups == 0).

This patch fixes the NFS server so that it handles this case correctly.

After MFC'ng this patch to stable/13 and stable/14, I propose that
this unusual case be deprecated and no longer allowed in FreeBSD15.
At that point, this patch can be reverted.

Reviewed by: brooks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47204