*BSD News Article 26080


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!bunyip.cc.uq.oz.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!usc!howland.reston.ans.net!pipex!sunic!trane.uninett.no!aun.uninett.no!flipper.pvv.unit.no!kari.fm.unit.no!arnej
From: arnej@kari.fm.unit.no (Arne Henrik Juul)
Newsgroups: comp.os.386bsd.bugs
Subject: Re: FreeBSD: UFS bug (and fix)
Date: 16 Jan 94 02:03:16
Organization: Norwegian Institute of Technology
Lines: 34
Message-ID: <ARNEJ.94Jan16020316@kari.kari.fm.unit.no>
References: <2h8v5f$78@tyrell.tynet.sub.org>
NNTP-Posting-Host: kari.fm.unit.no
In-reply-to: rodney@tyrell.tynet.sub.org's message of 15 Jan 1994 15:38:25 +0100

In article <2h8v5f$78@tyrell.tynet.sub.org> rodney@tyrell.tynet.sub.org (Rodney Volz) writes:

 > Hello,
 >
 > IMHO, there's a bug in /usr/src/sys/ufs/ufs_vnops.c concerning
 > the gid-handling when creating files.
 >
 > In FreeBSD/ufs, files are always created with their group-id
 > set to the group-id of their parent-directory. This behaviour
 > is neither POSIX nor BSD-conforming.

Wrong! This behavior is *both* POSIX and BSD-conforming.
I quote from the standard:

"The wording regarding the group of a newly created regular file,
 directory, or FIFO in open(), mkdir(), mkfifo(), respectively, defines
 the two acceptable behaviors in order to permit both the System V (and
 Version 7) behavior (in which the group of the new object is set to
 the effective group ID of the createing process) and the 4.3BSD
 behavor (in which the new object has the group of its parent
 directory)." [Any typos are mine].

 > Posix says, that the group-id of newly created files should be set to
 > the group-id of the creator. An optional Posix feature is, that
 > if the parent directory has a group S-bit set, the group-id
 > of the new file should be set to the group-id of its parent
 > directory.

This is not from POSIX, but a SunOS-ism which have spread to other
systems. The choice of behavior may also be a mount time option.
I prefer the BSD behavior, as do many others.

--
Arne H. Juul  --  arnej@lise.unit.no  --  University of Trondheim, Norway