From owner-freebsd-questions Mon Apr 2 19:12:20 2001 Delivered-To: freebsd-questions@freebsd.org Received: from nameserver.austclear.com.au (nameserver.austclear.com.au [192.83.119.132]) by hub.freebsd.org (Postfix) with ESMTP id E67CE37B727 for ; Mon, 2 Apr 2001 19:12:14 -0700 (PDT) (envelope-from ahl@austclear.com.au) Received: from tungsten.austclear.com.au (tungsten.austclear.com.au [192.168.70.1]) by nameserver.austclear.com.au (8.9.3/8.9.3) with ESMTP id MAA88503; Tue, 3 Apr 2001 12:12:13 +1000 (EST) Received: from tungsten (tungsten [192.168.70.1]) by tungsten.austclear.com.au (8.9.3/8.9.3) with ESMTP id MAA00183; Tue, 3 Apr 2001 12:12:13 +1000 (EST) Message-Id: <200104030212.MAA00183@tungsten.austclear.com.au> X-Mailer: exmh version 2.1.1 10/15/1999 To: Greg Lehey Cc: Aaron Hill , trond@ramstind.gtf.ol.no, freebsd-questions@FreeBSD.ORG Subject: Re: Is there an equivalent of newgrp in FreeBSD? In-Reply-To: Message from Greg Lehey of "Tue, 03 Apr 2001 10:56:42 +0930." <20010403105642.B71213@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2001 12:12:13 +1000 From: Tony Landells Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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