*BSD News Article 9168


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA5281 ; Wed, 23 Dec 92 05:01:32 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!serini
From: serini@ghost.dsi.unimi.it (Piero Serini)
Subject: setgroups() - bug ?
Organization: Computer Science Dep. - Milan University
Date: Sun, 20 Dec 1992 23:08:59 GMT
Message-ID: <1992Dec20.230859.11383@ghost.dsi.unimi.it>
Lines: 36

HI all.

I suspect there's a bug in setgrupos() call :

from /etc/passwd: foo::1000:1000: ...
from /etc/group:  foo:*:1000:

Now, user foo is of group foo and no other groups.
If foo does an 'id' he gets:
uid=1000(foo) gid=1000(foo) groups=1000(foo)

The question is: if a user belongs to one group only,
is it correct that id shows a 'groups' entry, or should
it be better to omit this ?
I personally think that a 'normal' id, that is with just
one group, should show no 'groups' entry, as it's obvious
I belong to groups foo if my gid is foo ...
In fact, if foo belongs to groups 'foo2' too, the id would
show:
uid=1000(foo) gid=1000(foo) groups=1000(foo), 1001(foo2)

while I think better:
uid=1000(foo) gid=1000(foo) groups=1001(foo2)

This is the way other Unixes act, say HP-UX for example.

Let me know what you think
Bye
Piero

------------------------------------------ Piero Serini -----------------
Piero Serini	                  E-mail: serini@ghost.dsi.unimi.it   
Computer Science Dept.            or: piero@strider.st.dsi.unimi.it
Univ. Statale - Milano - ITALY      ** mail me your .signature **
-------------------------------------------------------------------------