From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 13 00:13:33 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B64C116A41F for ; Sat, 13 Aug 2005 00:13:33 +0000 (GMT) (envelope-from mwm-keyword-hackers.e471b2@mired.org) Received: from delight.idiom.com (delight.idiom.com [216.240.32.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6298143D49 for ; Sat, 13 Aug 2005 00:13:33 +0000 (GMT) (envelope-from mwm-keyword-hackers.e471b2@mired.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id BBBB921862B for ; Fri, 12 Aug 2005 17:13:32 -0700 (PDT) Received: from mired.org (mwm@idiom [216.240.32.1]) by idiom.com (8.12.11/8.12.11) with SMTP id j7D0DVwU057475 for ; Fri, 12 Aug 2005 17:13:32 -0700 (PDT) (envelope-from mwm-keyword-hackers.e471b2@mired.org) Received: (qmail 27967 invoked by uid 1001); 13 Aug 2005 00:14:44 -0000 Received: by localhost.mired.org (tmda-sendmail, from uid 1001); Fri, 12 Aug 2005 20:14:43 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <17149.15219.714658.707699@bhuda.mired.org> Date: Fri, 12 Aug 2005 20:14:43 -0400 To: Brooks Davis In-Reply-To: <20050812233728.GA22225@odin.ac.hmc.edu> References: <42FD15EA.8050500@jonny.eng.br> <20050812233728.GA22225@odin.ac.hmc.edu> X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer Cc: hackers@freebsd.org, =?iso-8859-1?Q?Jo=E3o?= Carlos Mendes Luis Subject: Re: File create permissions, what am I missing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2005 00:13:33 -0000 In <20050812233728.GA22225@odin.ac.hmc.edu>, Brooks Davis typed: > On Fri, Aug 12, 2005 at 06:34:34PM -0300, Jo=E3o Carlos Mendes Luis w= rote: > > In a directory with -rwxrwxrwx, any user can create files, but who = should=20 > > be the owner/group of this file? > >=20 > > Long time ago in Unix history, the owner would be the user who crea= ted the=20 > > file, and the group would be the users's primary group. > >=20 > > Later, IIRC, if the directory group was one of the user's secondary= groups,=20 > > the file would also be from this group. > >=20 > > A later modification defined that a setgid directory would effect i= n all=20 > > files created belonging to the directory's user. > >=20 > > Am I correct? > >=20 > > But I have already tested 3 system, 2 with 5-stable and 1 with 4-st= able, in=20 > > which the created file inside a -rwxrwxrwx directory is created bel= onging=20 > > to the directory's group, WITHOUT the setgid bit. What did I miss?= >=20 > On BSD systems, the group of a file is always the group of the direct= ory > it is in. This differs from SysV UNIX. The resident grey-beard at w= ork > feels this is a new and annoying behavior. (i.e. it wasn't always thi= s > way. :) SysV lets you toggle that behavior on a per-directory basis. Turn the setgid bit on in the directory, and files created in it will be owned by the group that owns the directory. =09=09=09http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more informatio= n.