HomeFreeBSD

cred: crsetgroups(): Throw away old groups before crextend()

Description

cred: crsetgroups(): Throw away old groups before crextend()

Now that crextend() asserts that groups are not set (rightfully so,
since it may change the backing storage without copying the content of
the old one), have crsetgroups() throw away the old groups before
calling it, as it installs an entirely new set anyway.

This allows to reuse unshared credentials by resetting their groups set,
as NFS exports actually do.

Reported by: cy
Tested by: cy
Fixes: ea26c0e79752 ("cred: crextend(): Harden, simplify")
Pointy hat to: olce

While here, as I forgot these credits in commit 77d652b4b472 ("nfs:
Fallback to GID_NOGROUP on no groups"):
Tested by: cy, David Wolfskill (panics caused by mountd(8))
Tested by: kib (MINIMAL/custom kernel compile breakup)

Details

Provenance
olceAuthored on Sun, Nov 3, 6:04 PM
Parents
rG2ce493e1693b: Cleanup commit. Use PROGRAM instead of PROGGRAM.
Branches
Unknown
Tags
Unknown