From andreas@klemm.gtn.com  Thu Aug  6 00:16:35 1998
Received: from news1.gtn.com (news1.gtn.com [194.77.0.15])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA16129
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 6 Aug 1998 00:16:32 -0700 (PDT)
          (envelope-from andreas@klemm.gtn.com)
Received: (from uucp@localhost)
	by news1.gtn.com (8.8.6/8.8.6) with UUCP id JAA17563
	for FreeBSD-gnats-submit@freebsd.org; Thu, 6 Aug 1998 09:15:08 +0200 (MET DST)
Received: (from andreas@localhost)
	by klemm.gtn.com (8.9.1/8.8.8) id JAA03734;
	Thu, 6 Aug 1998 09:00:01 +0200 (CEST)
	(envelope-from andreas)
Message-Id: <199808060700.JAA03734@klemm.gtn.com>
Date: Thu, 6 Aug 1998 09:00:01 +0200 (CEST)
From: Andreas Klemm <andreas@klemm.gtn.com>
Reply-To: andreas@klemm.gtn.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: sgid bit on directories undocumented in chmod(1) and umask...
X-Send-Pr-Version: 3.2

>Number:         7504
>Category:       docs
>Synopsis:       sgid bit on directories undocumented in chmod(1) and umask...
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug  6 00:20:03 PDT 1998
>Closed-Date:    Thu Aug 6 23:06:57 PDT 1998
>Last-Modified:  Thu Aug  6 23:07:15 PDT 1998
>Originator:     Andreas Klemm
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	FreeBSD-current and surely -STABLE

>Description:

	The chmod manpage only describes that it's possible to
	set the s-bit for the directory owner, but it's also
	possible to set the s bit of a directory, so that files
	created in this directory get the GID of the directory
	group and not the GID of the person who created the file.

	It's possible that the mount manpage has to be updated
	as well.

	And ... look at Part II. When I remember right, then
	the s bit set's also the umask of that directory in
	SunOS 4 and 5. That makes it possible, to force workgroups
	to an umask of 002. Would that be a wanted feature or
	is it missing here ??? Other voices.

>How-To-Repeat:

	Part I
	======
	mkdir foo
	touch foo/before
	ls -l foo/before
	-rw-r--r--  1 root  wheel  0  6 Aug 08:47 before
	chgrp operator foo
	chmod g+s operator
	ls -ld foo
	drwxr-sr-x  2 root  operator  512  6 Aug 08:47 foo
	touch foo/after_sbit
	ls -l foo/after_sbit
	-rw-r--r--  1 root  operator  0  6 Aug 08:49 after_sbit
			    ^^^^^^^^

	Part II
	=======
	chmod g+w
	ls -ld foo
	drwxrwsr-x  2 root  operator  512  6 Aug 08:49 foo
	     ^ !
	touch foo/after_g+w
	ls -l foo/after_g+w
	-rw-r--r--  1 root  operator  0  6 Aug 08:51 after_g+w
	     ^ ?! missing ?

>Fix:
	
	Doku fix for chmod(1), chmod(2) and possibly mount(1)
	Concerning mount: there is a suiddir option, do we need
	a sgiddir option as well ???

>Release-Note:
>Audit-Trail:

From: Matthew Hunt <mph@pobox.com>
To: andreas@klemm.gtn.com, FreeBSD-gnats-submit@FreeBSD.ORG
Cc:  Subject: Re: docs/7504: sgid bit on directories undocumented in chmod(1) and umask...
Date: Thu, 6 Aug 1998 10:33:25 -0400

 On Thu, Aug 06, 1998 at 09:00:01AM +0200, Andreas Klemm wrote:
 
 > 	The chmod manpage only describes that it's possible to
 > 	set the s-bit for the directory owner, but it's also
 > 	possible to set the s bit of a directory, so that files
 > 	created in this directory get the GID of the directory
 > 	group and not the GID of the person who created the file.
 
 But... you describe the normal behavior of directories under
 BSD, regardless of the g+s bit!  Been hanging out in SysV land
 too much these days? :-)
 
 flarn:~/tmp$ mkdir spoo
 flarn:~/tmp$ ls -ld spoo
 drwxrwxr-x  2 mph  mph  512 Aug  6 10:31 spoo
 flarn:~/tmp$ touch spoo/fresh
 flarn:~/tmp$ ls -l spoo
 total 0
 -rw-rw-r--  1 mph  mph  0 Aug  6 10:32 fresh
 flarn:~/tmp$ chown :wheel spoo
 flarn:~/tmp$ touch spoo/daily
 flarn:~/tmp$ ls -l spoo
 total 0
 -rw-rw-r--  1 mph  wheel  0 Aug  6 10:32 daily
 -rw-rw-r--  1 mph  mph    0 Aug  6 10:32 fresh
 
 -- 
 Matthew Hunt <mph@pobox.com> * Inertia is a property of matter.
 http://www.pobox.com/~mph/pgp.key for PGP public key 0x67203349.
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Thu Aug 6 23:06:57 PDT 1998 
State-Changed-Why:  
misunderstood behaviour. 
>Unformatted:
