From owner-freebsd-questions@FreeBSD.ORG Sat Feb 9 10:44:25 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E569516A418 for ; Sat, 9 Feb 2008 10:44:25 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from hermes.hst.org.za (onix.hst.org.za [209.203.2.133]) by mx1.freebsd.org (Postfix) with ESMTP id 226D313C458 for ; Sat, 9 Feb 2008 10:44:24 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from [10.1.11.1] ([10.1.11.1]) (authenticated bits=0) by hermes.hst.org.za (8.13.8/8.13.8) with ESMTP id m19Ab3P0022831 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 9 Feb 2008 12:37:03 +0200 (SAST) (envelope-from jonathan+freebsd-questions@hst.org.za) From: Jonathan McKeown To: freebsd-questions@freebsd.org Date: Sat, 9 Feb 2008 12:44:05 +0200 User-Agent: KMail/1.9.4 X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?utf-8?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l=3B=7E!4?= =?utf-8?q?2HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?utf-8?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Spam-Score: -4.352 () ALL_TRUSTED,AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.61 on 209.203.2.133 Subject: mv, cp, and sgid on directories (was: cp -p) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2008 10:44:26 -0000 I think you may be getting too deep into the detail. Think of the bigger picture: when I move a file, I don't expect that to change its ownership or permissions - it would surprise me if it did; when I make a copy of a file, I expect to own the copy - after all, what use is a private copy I can't do anything with? FreeBSD generally tries hard not to behave in a surprising way. The bit that still worries me in this discussion is the sgid bit (pun not intended, but I'm not going to delete it now!): as I understand it, creating a file has different behaviour on SYSV-derived systems and Berkeley-derived systems. SYSV creates files group-owned by the creator's primary group. BSD creates files which inherit the group-ownership of the directory they are created in. SYSV behaviour can be changed to BSD behaviour per-directory, by using the sgid bit on the directory. BSD behaviour can't be changed and the sgid bit on a directory is ignored. Again, could someone confirm whether I'm talking nonsense here? Jonathan