Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Apr 2001 12:12:13 +1000
From:      Tony Landells <ahl@austclear.com.au>
To:        Greg Lehey <grog@lemis.com>
Cc:        Aaron Hill <hillaa@hotmail.com>, trond@ramstind.gtf.ol.no, freebsd-questions@FreeBSD.ORG
Subject:   Re: Is there an equivalent of newgrp in FreeBSD? 
Message-ID:  <200104030212.MAA00183@tungsten.austclear.com.au>
In-Reply-To: Message from Greg Lehey <grog@lemis.com>  of "Tue, 03 Apr 2001 10:56:42 %2B0930." <20010403105642.B71213@wantadilla.lemis.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

grog@lemis.com said:
> Funny about this.  I was just researching it yesterday.  Can you say
> what happens under Solaris if I (user grog) am a member of groups
> lemis and wheel, and my currently active group is lemis, when I try to
> open this file?

> -rw-r-----   1 root  wheel     94 Mar 31 10:45 foo.c

> On FreeBSD, it will work, because there's no concept of "currently
> active group".

> Somebody told me that it would work under System V as well, and that
> the current group was simply the group to which newly created files
> would belong.  Under FreeBSD you don't get a choice of ownership of
> new files: they belong to the same group as the directory does.  If
> you want a different group, you need to change it explicitly. 

Under Solaris you can access files in any group you're a member of.

If you create a file in a directory with the setgid bit, then the file
will be created in that group even if you don't belong to it.

If the directory doesn't have the setgid bit, then the file will have
your current group (as determined by your primary group from /etc/passwd
by default, or a group you've selected by newgrp).

Once the file's there you can put it in any group you belong to using
chgrp.

I think that covers all the options for group ownership...

Tony
-- 
Tony Landells					<ahl@austclear.com.au>
Senior Network Engineer				Ph:  +61 3 9677 9319
Australian Clearing Services Pty Ltd		Fax: +61 3 9677 9355
Level 4, Rialto North Tower
525 Collins Street
Melbourne VIC 3000
Australia



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104030212.MAA00183>