From dbx@atmos.washington.edu  Fri Aug 29 08:30:20 1997
Received: from cargpc5.atmos.washington.edu (cargpc5.atmos.washington.edu [128.95.176.98])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id IAA09963
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 1997 08:30:16 -0700 (PDT)
Received: by cargpc5.atmos.washington.edu
	(8.8.5/UW-NDC Revision: 2.30v8.8) id IAA04229; Fri, 29 Aug 1997 08:32:49 -0700 (PDT)
Message-Id: <199708291532.IAA04229@cargpc5.atmos.washington.edu>
Date: Fri, 29 Aug 1997 08:32:49 -0700 (PDT)
From: dbx@atmos.washington.edu
Reply-To: dbx@atmos.washington.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Sticky directories change file group
X-Send-Pr-Version: 3.2

>Number:         4418
>Category:       kern
>Synopsis:       "Sticky" directories change group ownership of files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 29 08:40:01 PDT 1997
>Closed-Date:    Sat Sep 6 10:06:30 MEST 1997
>Last-Modified:  Sat Sep  6 01:20:03 PDT 1997
>Originator:     "Doug Burks"
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
Dept of Atmospheric Sciences, Univ of Washington
>Environment:
unimportant

>Description:

I hope I'm not out in left field on this, as I don't have a POSIX manual,
but ...

If a directory has a sticky bit set, it will change the group ownership
of any file created in that directory to the group owning the directory.
If my understanding is correct, the group ownership should only be
changed if the set-group-id bit is set on the directory permissions, not
the sticky bit.

Note that the user ownership is correct, and that the set-group-id bit
works as it should.

If I am out in left field on this, I apologize for bothering you!

>How-To-Repeat:

From your favorite command shell --

   $ mkdir stick
   $ chmod 1777 stick
   $ su -
   # chown root.bin stick
   # exit
   $ cd stick
   $ touch file
   $ ls -l

and you will see that "file" is owned by the group "bin", not the user's
group.
   
>Fix:
	
Unknown, though I suspect a small little typo somewhere.  :)  This
problem is easy to work-around, though a bit annoying.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sat Sep 6 10:06:30 MEST 1997 
State-Changed-Why:  

Inheriting the group ownership used to be the BSD file creation 
semantics for ages, so this is on purpose (and not only on `sticky' 
directories, although it makes less sense on these than on normal 
dirs). 

From: j@uriah.heep.sax.de (J Wunsch)
To: dbx@atmos.washington.edu
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/4418: Sticky directories change file group
Date: Sat, 6 Sep 1997 09:33:52 +0200

 As dbx@atmos.washington.edu wrote:
 
 > If a directory has a sticky bit set, it will change the group ownership
 > of any file created in that directory to the group owning the directory.
 
 Any file created anywhere in a BSD filesystem will get the group
 ownership of the parent directory.  This is done on purpose, and is
 often referred to as the BSD group semantics.  Posix allows for this
 as an option.
 
 What you've seen on some other systems is that they by default follow
 the SysV semantics, and emulate the BSD semantics if the sgid bit is
 set on the parent directory.  *BSD doesn't allow for an emultion of
 the SysV semantics at all.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
>Unformatted:
