Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 1999 16:24:13 +0100
From:      Dom Mitchell <Dom.Mitchell@palmerharvey.co.uk>
To:        Brian Dean <brdean@unx.sas.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: behaviour of open(foo,O_CREAT) in regards to setting 'group' 
Message-ID:  <E10WiZJ-000L3d-00@voodoo.pandhm.co.uk>
In-Reply-To: Brian Dean's message of "Mon, 12 Apr 1999 11:02:18 EDT" <199904121502.LAA15248@dean.pc.sas.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
On 12 April 1999, Brian Dean proclaimed:
> In FreeBSD, the open(foo,O_CREAT) call creates the file and sets the
> group of the new file to that of the directory in which the file was
> created.

Yup.

> Why do we not set the group of the new file to the effective group id
> of the process creating the file?  Or, if the set-gid bit is set on
> the directory in which the file is being created, use that over the
> effective gid of the process?  (This appears to be the behaviour of
> SVR4.)

That's correct, and it's listed as "BSD emulation behaviour", for the
reason that we've always done it that way.

> For example, if the group of /tmp is wheel, the FreeBSD behaviour
> causes files created there to have the group of wheel, and when the
> files are moved to another (non-local) file system (using 'mv'), an
> error is generated indicating that the operation is not permitted if
> the user is not a member of 'wheel'.  The error is harmless in this
> case (because the group of the file should not have been wheel in the
> first place because the user was not a member of wheel), but it is
> annoying.

Maybe the behaviour should not apply to directories with a sticky bit?
I'm not sure that there is much room for change around this whole
subject area, though.  It's been pretty much this way for some 15 years
or more.  Teach your users to use "cp" instead of "mv"?
-- 
Dom Mitchell -- Palmer & Harvey McLane -- Unix Systems Administrator

	"Value of 2 may go down as well as up"
		-- FORTRAN programmers manual 
-- 
**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please notify 
the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.
**********************************************************************


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E10WiZJ-000L3d-00>