bin/166553: find -delete documentation is misleading
matthewstory at gmail.com
Sun Apr 1 17:30:17 UTC 2012
The following reply was made to PR bin/166553; it has been noted by GNATS.
From: Matthew Story <matthewstory at gmail.com>
To: Richard Kettlewell <rjk at greenend.org.uk>
Cc: freebsd-gnats-submit at freebsd.org
Subject: Re: bin/166553: find -delete documentation is misleading
Date: Sun, 1 Apr 2012 13:24:03 -0400
On Sun, Apr 1, 2012 at 5:24 AM, Richard Kettlewell <rjk at greenend.org.uk> wr=
> The documentation for 'find -delete' includes the following remark:
> =A0 =A0It will not attempt to delete a filename with a =93/=94 character =
in its pathname relative to =93.=94 for security reasons.
> This reflects a defensive test early in f_delete. However, the test will =
not succeed, since find does not use FTS_NOCHDIR, so entry->fts_accpath sho=
uld never contain "/".
$ # show test succeeds
$ mkdir -p foo/bar/baz
$ find ./foo -delete
find: -delete: ./foo: relative path potentially not safe
The reason that fts_accpath contains a leading ``./'' in this case is
that fts, even without FTS_NOCHDIR, does not chdir into the parent
directory of depth 0 directories on the first pass, fts_accpath will
always equal fts_pathname on depth 0 FTSENTs.
> I suggest that this remark be deleted from the man page.
> freebsd-bugs at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-bugs-unsubscribe at freebsd.org"
More information about the freebsd-bugs