From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 29 11:30:15 2004 Return-Path: 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 1E64C16A4CF for ; Mon, 29 Nov 2004 11:30:15 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A41943D3F for ; Mon, 29 Nov 2004 11:30:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iATBUEUi019117 for ; Mon, 29 Nov 2004 11:30:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iATBUE2o019116; Mon, 29 Nov 2004 11:30:14 GMT (envelope-from gnats) Date: Mon, 29 Nov 2004 11:30:14 GMT Message-Id: <200411291130.iATBUE2o019116@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ceri Davies Subject: Re: bin/74500: [PATCH] allow chflags to set flags on symlinks X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ceri Davies List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2004 11:30:15 -0000 The following reply was made to PR bin/74500; it has been noted by GNATS. From: Ceri Davies To: Dan Nelson Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/74500: [PATCH] allow chflags to set flags on symlinks Date: Mon, 29 Nov 2004 11:24:06 +0000 On Sun, Nov 28, 2004 at 10:44:42PM -0600, Dan Nelson wrote: > > /bin/chflags always calls chflags(2), which means that it drills > through symlinks and changes attricutes on the underlying files. This > may not be what is intended if the user wants to prevent the symlink > itself from being changed (to point to a different location, for > example). > > The prototypes for chflags and fchflags are also incorrect; they take > an int argument, not an unsigned long. > > >How-To-Repeat: > > >Fix: > > Apply the following patch which adds the -h switch, copied from the > chown code. A newer version may be at > http://dan.allantgroup.com/FreeBSD/ . > > @@ -72,6 +73,9 @@ > .It Fl R > Change the file flags for the file hierarchies rooted > in the files instead of just the files themselves. > +.It Fl h > +If the file is a symbolic link, change the user ID and/or the > +group ID of the link itself. A little bit *too* copied from chown? ;-) Ceri -- Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Einstein (attrib.)