bin/90687: [patch] side effect of -delete option of find(1)
Nikos Ntarmos
ntarmos at ceid.upatras.gr
Mon Sep 3 20:10:14 PDT 2007
The following reply was made to PR bin/90687; it has been noted by GNATS.
From: Nikos Ntarmos <ntarmos at ceid.upatras.gr>
To: bug-followup at freebsd.org, anatoli at 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 ----
More information about the freebsd-bugs
mailing list