[net.unix] A question for all you UN*X experts

aims@ssc-vax.UUCP (John Daley) (08/22/85)

 
We have a question that maybe you can answer.  Does anyone out there know
of any utilities that use the information in /etc/group?  We keep our file
up to date, but have never noticed any system uses for this file.  I have
used fgrep to compare group id numbers and user names, but that is a script
that I developed for simple cross-checking.
 
Just wondering...Thanx in advance!  (Please post responses in net.unix)
 
-- 


From the merciless keys of Ray Saddler
 
Nothing I say here is to be held against the Boeing company,
 
It's not their fault!
 
                              Ray E. Saddler III
                              Boeing Aerospace Company
                              CAD Support and Administration
                              Seattle, Washington
                              USA
                              Earth
                              Somewhere in the universe
                              lost in space.....

dan@mgweed.UUCP (Daniel Gray) (08/26/85)

On our systems, the /etc/group file contains the names of those logins
that can change group with `newgrp` command. It changes your group id
to that of the group requested, (if you are listed) so that you can
access files owned by the other group.

Daniel Gray

alan@drivax.UUCP (Alan Fargusson) (08/26/85)

> We have a question that maybe you can answer.  Does anyone out there know
> of any utilities that use the information in /etc/group?  We keep our file
> up to date, but have never noticed any system uses for this file.

Ls(1), and newgrp(1) uses it. On 5.2.2 ls(1) prints the group by default,
but othere flavors of UNIX it is an option.
-- 

Alan Fargusson.

{ ihnp4, amdahl, mot }!drivax!alan

carl@bdaemon.UUCP (carl) (08/27/85)

> 
>  
> We have a question that maybe you can answer.  Does anyone out there know
> of any utilities that use the information in /etc/group?  We keep our file
> up to date, but have never noticed any system uses for this file.  I have
> used fgrep to compare group id numbers and user names, but that is a script
> that I developed for simple cross-checking.
>  
> Just wondering...Thanx in advance!  (Please post responses in net.unix)

The shell builtin 'newgrp' is but one example.

Carl Brandauer
daemon associates
1760 Sunset Blvd.
Boulder, CO 80302
{allegra|amd|attunix|cbosgd|ucbvax}!nbires!bdaemon!carl

broman@noscvax.UUCP (Vincent P. Broman) (08/27/85)

> We have a question that maybe you can answer.  Does anyone out there know
> of any utilities that use the information in /etc/group?  We keep our file
> up to date, but have never noticed any system uses for this file.

just the obvious one-- it determines your group access permissions. On
4.2BSD at least, this is done by a call to initgroups(3X) in login.c .


Vincent Broman			MILNET: broman@nosc
Analysis Branch, code 632	UUCP: {ihnp4,decvax,akgua,dcdwest,ucbvax}!
Naval Ocean Systems Center			sdcsvax!noscvax!broman
San Diego, CA  92152		MaBellNet: (619) 225-2365

electrohome@watcgl.UUCP (electrohome) (08/28/85)

Please get this discussion out of net.misc now that there are some reasonable
responses.

fred@mot.UUCP (Fred Christiansen) (08/29/85)

don't forget grpck(1M) to sanity-check /etc/group cross-matched to /etc/passwd
	       ^
	       | wasn't this the name of the Czech Pres/P.M. back in '67? :-)
-- 
<< Generic disclaimer >>
Fred Christiansen ("Canajun, eh?") @ Motorola Microsystems, Tempe, AZ
UUCP:  ihnp4!{attunix, btlunix, drivax, sftig, ut-sally!oakhill}!mot!fred
ARPA:  oakhill!mot!fred@ut-sally.ARPA             AT&T:  602-438-3472

cmv@cbnap.UUCP (Craig Votava) (08/30/85)

In article <217@drivax.UUCP> alan@drivax.UUCP (Alan Fargusson) writes:
> We have a question that maybe you can answer.  Does anyone out there know
> of any utilities that use the information in /etc/group?  We keep our file
> up to date, but have never noticed any system uses for this file.

Doesn't old mail(1) (not mailx) allow you to mail <group> which will mail
to the whole group?


                Craig Votava

                ...ihnp4!cbnap!cmv
		cb/eadas/nap - datakit

matt@saber.UUCP (Matt Perez) (08/30/85)

>  
> We have a question that maybe you can answer.  Does anyone out there know
> of any utilities that use the information in /etc/group?  We keep our file
> up to date, but have never noticed any system uses for this file.  I have
> used fgrep to compare group id numbers and user names, but that is a script
> that I developed for simple cross-checking.
>  
> Just wondering...Thanx in advance!  (Please post responses in net.unix)
>

"ls -g" to display the file owner's group name.

matt perez
saber technology/2381 bering drive/san jose ca 95131
408 945-9600
saber!matt

chuqui@nsc.UUCP (Chuq Von Rospach) (08/30/85)

[followups will be rerouted to only net.unix as the best place to continue
 this discussion]

In article <1762@saber.UUCP> matt@saber.UUCP (Matt Perez) writes:
>>  
>> We have a question that maybe you can answer.  Does anyone out there know
>> of any utilities that use the information in /etc/group?  We keep our file
>> up to date, but have never noticed any system uses for this file.
>
>"ls -g" to display the file owner's group name.

I had expected someone to mention this by now, but since I haven't seen it,
4.2BSD Un*x added the capability to be in multiple groups at the same time,
based on the data in the /etc/group file. This means, for example, that you
could have your default group be "staff" in /etc/passwd, but also be in 
grous like "kernel" or "netnews" or whatever at the same time. This allows
you to use the group permissions on files and directories in a pretty
flexible way (finally) for allowing access to various development areas on
a single machine. This means that (in essence) any utility can use or
misused the information in /etc/group depending on how you want to set
things up...

chuq
access to
-- 
Chuq Von Rospach nsc!chuqui@decwrl.ARPA {decwrl,hplabs,ihnp4}!nsc!chuqui

Son, you're mixing ponderables again

nz@wucs.UUCP (Neal Ziring) (08/30/85)

In article <147@ssc-vax.UUCP>, aims@ssc-vax.UUCP (John Daley) writes:
> 
> We have a question that maybe you can answer.  Does anyone out there know
> of any utilities that use the information in /etc/group?  We keep our file
> up to date, but have never noticed any system uses for this file.  
>  
> Just wondering...Thanx in advance!  (Please post responses in net.unix)
> 
> From the merciless keys of Ray Saddler

	The /etc/group file is the system master list of group accesses.

	For user programs, it is used for translating gid values into
	mnemonic names  (gid 100 = staff, for instance).  There are 
	library routines that open, read, and parse the file, so you will
	never see a program actually open the file "/etc/group".  The
	information about these library routines can get read in manual
	entry getgrent(3).

	The more important use of /etc/group (actually groups in a
	more general sense) is in the kernel.  You may have noticed
	by now that all files have four bits of permission related to
	user group.  When you login, or su, the program reads the 
	/etc/group file to determine what groups you are a member of, 
	and performs the system call  setgroups(2)  to tell the kernel
	that you belong to a certain list of groups (an array of gids)
	and no others.

	For further information, see  setgroups(2), access(2), 
	getgrent(3), group(5), and the source for libc.
-- 
========
...nz (ECL - we're here to provide superior computing)
	Washington University Engineering Computer Laboratory

    "Now we'll see some proper action..." 

	old style:	... ihnp4!wucs!nz
	new style:	nz@wucs.UUCP

jeq@laidbak.UUCP (Jonathan E. Quist) (09/01/85)

>> We have a question that maybe you can answer.  Does anyone out there know
>> of any utilities that use the information in /etc/group?  We keep our file

It comes in handy for granting access to group-maintained
files without granting global access.

E.G.

`cat /etc/group`
...
wheel:*:0:root,phred
cheese:*:6:mrbig,msbig,buffy,johnboy,zaphod
users::123:winkin,blinkin,nod,phred
abusers::456:hardrock,coco,joe,phred
...

`ls -lg /usr/local/*userfile /etc/passwd /usr/games/rogue`

-rw-rw-r--  1 blinkin  users       94066 Jul  1 10:34 /usr/local/userfile
-rw-rw----  1 coco     abusers        13 Jul  4  1776 /usr/local/abuserfile
-rw-r--r--  1 root     wheel       11307 Aug 29 22:06 /etc/passwd
-rws--x---  1 daemon   cheese     117760 Apr 28 15:38 /usr/games/rogue
                ^        ^
              owner    group

Blinkin owns ``userfile''; winkin, blinkin, and nod (the ``users'' can all
read from and write to this file.

Coco owns ``abuserfile'';  hardrock, coco, and joe (``abusers'') can
all read and write this file.
The `regular' users can _not_ read abuserfile.

Everyone can read /etc/passwd.

Phred, being something of a minor deity, can read and write both files,
as well as /etc/passwd.  (Phred had better be a trusted user.)

Only members of group cheese (XYZ company's presidant and his family)
are allowed to play ``rogue''.

Everyone agree?  Light your oxy-acetylene torches if I've got
any of the details wrong.

Jonathan E. Quist
Lachman Associates, Inc.
ihnp4!laidbak!jeq
``I deny this is a disclaimer.''

marinkov@gumby.UUCP (09/10/85)

> On our systems, the /etc/group file contains the names of those logins
> that can change group with `newgrp` command. It changes your group id
> to that of the group requested, (if you are listed) so that you can
> access files owned by the other group.
> 
> Daniel Gray

*** REPLACE THIS LINE WITH YOUR MESSAGE ***