From owner-freebsd-questions Mon Apr 2 23:25:53 2001 Delivered-To: freebsd-questions@freebsd.org Received: from flarn.it.ca (it.ca [199.45.111.1]) by hub.freebsd.org (Postfix) with ESMTP id ABADC37B724 for ; Mon, 2 Apr 2001 23:25:51 -0700 (PDT) (envelope-from paul@flarn.it.ca) Received: (from paul@localhost) by flarn.it.ca (8.9.3/8.9.3) id CAA35133; Tue, 3 Apr 2001 02:24:21 -0400 (EDT) (envelope-from paul) Date: Tue, 3 Apr 2001 02:24:01 -0400 From: Paul Chvostek To: Greg Lehey Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Is there an equivalent of newgrp in FreeBSD? Message-ID: <20010403022401.S12995@flarn.it.ca> References: <20010403105642.B71213@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010403105642.B71213@wantadilla.lemis.com>; from grog@lemis.com on Tue, Apr 03, 2001 at 10:56:42AM +0930 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I've always found the lack of something equivalent to newgrp to be a bit of a hassle. Not a big hassle, just a bit of one.... I think the default file creation group *should* be a function of whatever creates the file (fopen(), etc), so it's hard to imagine it being set by a separate program or even an environment variable. I've never looked at source for Solaris' newgrp, so I don't know what it *really* does. ;) > 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". In Solaris, the newgrp-selected group only affects the "default", not the permissions. If you're in a group, you have permissions according to that group. Perhaps it sets the egid for the shell, and fopen()'s grab that instead of using the directory's group (notwithstanding the setgid bit)? I dunno. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message