Date: Fri, 12 Aug 2005 20:14:43 -0400 From: Mike Meyer <mwm-keyword-hackers.e471b2@mired.org> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: hackers@freebsd.org, =?iso-8859-1?Q?Jo=E3o?= Carlos Mendes Luis <jonny@jonny.eng.br> Subject: Re: File create permissions, what am I missing? Message-ID: <17149.15219.714658.707699@bhuda.mired.org> In-Reply-To: <20050812233728.GA22225@odin.ac.hmc.edu> References: <42FD15EA.8050500@jonny.eng.br> <20050812233728.GA22225@odin.ac.hmc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
In <20050812233728.GA22225@odin.ac.hmc.edu>, Brooks Davis <brooks@one-e= yed-alien.net> 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<mike --=20 Mike Meyer <mwm@mired.org>=09=09http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more informatio= n.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17149.15219.714658.707699>