Subject: groupmember() bug?
To: None <bugs@openbsd.org>
From: None <rick@snowhite.cis.uoguelph.ca>
List: tech-kern
Date: 03/28/2003 15:07:26
I just noticed something that popped up on comp.protocols.nfs, which seems
like it might be a bug in several BSD flavours?

groupmember() - only checks cr_groups[] and not cr_gid


In 4.4, cr_gid was just cr_groups[0], but some subsequent flavours have
separated it out from cr_groups[] in "struct ucred".

As a result, ufs_chown() fails to change the gid of a file to the primary
gid (cr_gid) of a user, unless that gid is also listed in cr_groups[].
(This showed up as an NFS setattr problem for setting a gid of a newly
 created file to the client user's primary effective gid.)

Is this a bug? rick