Date: Mon, 29 Nov 2004 11:30:14 GMT From: Ceri Davies <ceri@submonkey.net> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/74500: [PATCH] allow chflags to set flags on symlinks Message-ID: <200411291130.iATBUE2o019116@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/74500; it has been noted by GNATS. From: Ceri Davies <ceri@submonkey.net> To: Dan Nelson <dnelson@allantgroup.com> 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.)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411291130.iATBUE2o019116>