bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A new utility: trv


From: James Youngman
Subject: Re: A new utility: trv
Date: Wed, 5 Jan 2005 21:55:15 +0000
User-agent: Mutt/1.3.28i

On Wed, Jan 05, 2005 at 09:17:40PM +0100, Giuliano Colla wrote:

> p.s. The versions of find I have around on RHEL (findutils 4.1.7) 
> doesn't support the -execdir action. When did it pop up?

Findutils 4.1.7 is just over 10 years old now.  The current version on
ftp://ftp.gnu.org/gnu/findutils is 4.1.20, and the current version on
alpha.gnu.org is 4.2.11.  

The -execdir action was introduced by *BSD as a secure alternative to
the insecure-by-design -exec action that Unixes have had for years
(and which POSIX standardises).  GNU findutils does not yet support
-execdir, though support is planned soon.  There is a patch on
http://savannah.gnu.org/ which implements -execdir, but it's slightly
out-of-date and probably won't apply cleanly.  The logical way to
implement it is just after implementing support for the '+' terminator
for -exec (which, again, is mandated by POSIX).

The documentation for findutils 4.2.11 (released very recently)
discusses the insecurity of -exec and why -execdir is a good idea but
(as the documentation states) it's not implemented yet.

On Wed, 05 Jan 2005 21:47:42 +0100, Alfred M. Szmidt wrote: 

| It is a BSD thing; would be nice to see in GNU find.  Would you like
| to work on that? I'm quite sure Paul Eggert (I think he is the
| maintainer of GNU findutils) would be happy to accept such a feature.

The only difficulty is that support for '-exec {} +' requires
implementing in find some functionality which is quite similar to that
of xargs.  This is simple enough in principle but is probably best
done by some refactoring to share the same code between find and
xargs.   That means my current plan is :

1. Improve the test suite, paying particular attention to xargs 
   so that I will know if I break it later
2. Refactor the find code so that it makes use of the xargs functionality 
   for building command lines 
3. Use this to support '-exec {} +'.
4. Implement '-execdir {} ;'
5. Implement '-execdir {} +'

Help with any of these items would be very welcome.  For what it's
worth, I am the current maintainer of GNU findutils, and have been
since just before the releaase of findutils 4.1.20.  Paul Eggert is
credited in the Findutils AUTHORS file, and still makes contributions
to findutils, but mostly indirectly by way of gnulib.

James.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]