From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 27 20:30:23 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E54CF16A41F for ; Wed, 27 Jul 2005 20:30:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CC7D43D46 for ; Wed, 27 Jul 2005 20:30:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6RKUNBA087916 for ; Wed, 27 Jul 2005 20:30:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6RKUN4e087909; Wed, 27 Jul 2005 20:30:23 GMT (envelope-from gnats) Date: Wed, 27 Jul 2005 20:30:23 GMT Message-Id: <200507272030.j6RKUN4e087909@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Chris Dillon Cc: Subject: Re: bin/74500 : [PATCH] allow chflags to set flags on symlinks X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Chris Dillon List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 20:30:24 -0000 The following reply was made to PR bin/74500; it has been noted by GNATS. From: Chris Dillon To: bug-followup@FreeBSD.org, dnelson@allantgroup.com Cc: Subject: Re: bin/74500 : [PATCH] allow chflags to set flags on symlinks Date: Wed, 27 Jul 2005 15:27:35 -0500 (CDT) I wanted to point out that I have been using this patch for quite a while now, but thought I would mention that the following part of the patch is not strictly necessary: if (Rflag) { fts_options = FTS_PHYSICAL; + if (hflag && (Hflag || Lflag)) + errx(1, "the -R%c and -h options may not be " + "specified together", Hflag ? 'H' : 'L'); It is OK to use '-R' and '-h', and '-H || -L' together, but may not have the expected behaviour. This behaviour is already (indirectly) documented in the manual page, so there is no reason to prevent it. If the filespec to chflags contains a symlink, as expected, you must use '-L' or '-H' to have that symlink in the filespec followed. When combining one of these options with '-h' and '-R', for example when using '-h -H -R' with the filespec containing a symlink pointing to a directory, the symlink and everything under the directory it is pointing to will have its flag changed, but the actual directory the symlink is pointing to (the link target) will NOT have its flag changed. This is the expected behaviour of the lchflags() system call and is correct with that in mind. Even the chflags(1) manual page says '-h' will "change the flag of the link rather than the file to which it points", so this is documented. With that in mind, I think we should also have an option to "change the flag of the link AND the file to which it points". This should apply to chmod(1) and chown(1) as well. -- Chris Dillon - cdillon(at)wolves.k12.mo.us FreeBSD: The fastest, most open, and most stable OS on the planet - Available for IA32, IA64, AMD64, PC98, Alpha, and UltraSPARC architectures - PowerPC, ARM, MIPS, and S/390 under development - http://www.freebsd.org Q: Because it reverses the logical flow of conversation. A: Why is putting a reply at the top of the message frowned upon?