From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 4 03:10:14 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45DCB16A418 for ; Tue, 4 Sep 2007 03:10:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3A11913C459 for ; Tue, 4 Sep 2007 03:10:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l843ADKU040739 for ; Tue, 4 Sep 2007 03:10:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l843ADT6040738; Tue, 4 Sep 2007 03:10:13 GMT (envelope-from gnats) Date: Tue, 4 Sep 2007 03:10:13 GMT Message-Id: <200709040310.l843ADT6040738@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Nikos Ntarmos Cc: Subject: Re: bin/90687: [patch] side effect of -delete option of find(1) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Nikos Ntarmos List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2007 03:10:14 -0000 The following reply was made to PR bin/90687; it has been noted by GNATS. From: Nikos Ntarmos To: bug-followup@freebsd.org, anatoli@aksoft.net Cc: Subject: Re: bin/90687: [patch] side effect of -delete option of find(1) Date: Tue, 4 Sep 2007 06:06:16 +0300 I just stumbled upon this issue while reading the manpage for find(1). IMHO the fact that -delete turns -follow off is a good thing, so I consider this more of a bug in the manpage. The included patch removes the erroneous example and adds a word or two about -delete not honoring -L. There is a mention of -delete not interacting well with options that alter the traversal algorithm, but that is somewhat vague in this case. --- find.1.diff begins here --- Index: find.1 =================================================================== RCS file: /opt/freebsd/cvs/src/usr.bin/find/find.1,v retrieving revision 1.82 diff -u -r1.82 find.1 --- find.1 28 Feb 2007 10:19:25 -0000 1.82 +++ find.1 4 Sep 2007 02:56:40 -0000 @@ -306,6 +306,24 @@ .Dq Pa \&. for security reasons. Depth-first traversal processing is implied by this option. +Moreover, beware that +.Ic -delete +does +.Ar not +honor the semantics of +.Ic -L +since it turns off following of symbolic links for security reasons. +Thus, +.Pp +.Dl "find -L /usr/ports/packages -type l -delete" +.Pp +would delete +.Ar all +symbolic links under +.Ar /usr/ports/packages +as if +.Ic -L +had not been defined in the command line at all. .It Ic -depth Always true; same as the @@ -843,9 +861,6 @@ Use the .Xr echo 1 command to print out a list of all the files. -.It Li "find -L /usr/ports/packages -type l -delete" -Delete all broken symbolic links in -.Pa /usr/ports/packages . .It Li "find /usr/src -name CVS -prune -o -depth +6 -print" Find files and directories that are at least seven levels deep in the working directory ---- find.1.diff ends here ----