*BSD News Article 48479


Return to BSD News archive

Xref: sserve comp.unix.bsd:16708 comp.os.386bsd.bugs:3083 comp.unix.bsd.386bsd.misc:129 comp.unix.bsd.bsdi.misc:581 comp.unix.bsd.misc:162 comp.unix.bsd.freebsd.misc:4434 comp.unix.bsd.netbsd.misc:726 comp.mail.smail:1514
Newsgroups: comp.unix.bsd,comp.os.386bsd.bugs,comp.unix.bsd.386bsd.misc,comp.unix.bsd.bsdi.misc,comp.unix.bsd.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.netbsd.misc,comp.mail.smail
Path: sserve!euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!vtc.tacom.army.mil!news1.oakland.edu!newsxfer.itd.umich.edu!srvr1.flint.umich.edu!news.gmi.edu!usenet.eel.ufl.edu!hookup!noc.tor.hookup.net!ve3ied!whome!gts!reptiles.org!jim
From: jim@reptiles.org (Jim Mercer)
Subject: Bug in setgroups() (FreeBSD, maybe NET/BSDI/4.4)
Message-ID: <DD28DH.997@reptiles.org>
Followup-To: comp.unix.bsd.misc
Organization: Reptilian Research, Toronto, Canada
Date: Wed, 9 Aug 1995 20:17:40 GMT
Lines: 26

i found this bug in FreeBSD 2.0, and reported it, and see that it is still
in 2.0.5.

this bug could possibly be in all 4.3/4.4 based BSD's depending on how
the setgroups() and/or nfs drivers were hacked.

basically, the setgroups() call takes 2 args, numgrps, and array_of_groups.

if setgroups() is called with numgrps = 0, FreeBSD (at least) will delete
the current processes group associations, all of them including the
default login group.

when playing with smail3, with the users $HOMES, and /var/spool/mail mounted
via NFS, this caused core dumps in FreeBSD-1.1.5.1, kernel panics in 2.0+.

the cause is that the nfs drivers in the kernel do not know how to react
when there are no groups.

should the NFS code be modified, or should setgroups() at least set
the default login group, if numgrps == 0?

-- 
[ Jim Mercer                 jim@reptiles.org              +1 416 506-0654 ]
[ "Never pet your dog when it is on fire."                                 ]
[     -- http://pharmdec.wustl.edu/cgi-bin/jardin_scripts/SCG              ]
[ Reptilian Research                      Longer Life through Colder Blood ]