From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 13 06:11:17 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 998FA16A41F for ; Sat, 13 Aug 2005 06:11:17 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DFC443D49 for ; Sat, 13 Aug 2005 06:11:15 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j7D6BBVB042732; Sat, 13 Aug 2005 01:11:11 -0500 (CDT) (envelope-from dan) Date: Sat, 13 Aug 2005 01:11:11 -0500 From: Dan Nelson To: Mike Meyer Message-ID: <20050813061111.GA46146@dan.emsphone.com> References: <42FD15EA.8050500@jonny.eng.br> <20050812233728.GA22225@odin.ac.hmc.edu> <17149.15219.714658.707699@bhuda.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17149.15219.714658.707699@bhuda.mired.org> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: hackers@freebsd.org, Jo~ao 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 06:11:17 -0000 In the last episode (Aug 12), Mike Meyer said: > In <20050812233728.GA22225@odin.ac.hmc.edu>, Brooks Davis typed: > > On Fri, Aug 12, 2005 at 06:34:34PM -0300, Jo~ao Carlos Mendes Luis wrote: > > > In a directory with -rwxrwxrwx, any user can create files, but > > > who should be the owner/group of this file? > > > > On BSD systems, the group of a file is always the group of the > > directory it is in. This differs from SysV UNIX. The resident > > grey-beard at work feels this is a new and annoying behavior. (i.e. > > it wasn't always this 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. Unfortunately, FreeBSD doesn't honor the "subdirectories created under SGID subdirectories inherit the flag" rule, so you can't serve SysV clients from FreeBSD NFS hosts without the permissions getting screwed up (SysV clients expect the nfs server to set the bit). Fix: RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_vnops.c,v retrieving revision 1.271 diff -u -r1.271 ufs_vnops.c --- ufs_vnops.c 9 Jun 2005 20:20:31 -0000 1.271 +++ ufs_vnops.c 14 Jun 2005 18:22:01 -0000 @@ -1336,6 +1336,8 @@ ip = VTOI(tvp); ip->i_gid = dp->i_gid; DIP_SET(ip, i_gid, dp->i_gid); + if (dp->i_mode & ISGID) + dmode |= ISGID; #ifdef SUIDDIR { #ifdef QUOTA -- Dan Nelson dnelson@allantgroup.com