bug-findutils
[Top][All Lists]
Advanced

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

[bug #17782] unwanted prefix "./" before arguments when using -execdir w


From: Andreas Metzler
Subject: [bug #17782] unwanted prefix "./" before arguments when using -execdir with find
Date: Thu, 19 Oct 2006 17:26:52 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060926 Debian/1.7.8-1sarge7.3.1

Follow-up Comment #4, bug #17782 (project findutils):

WANG Yunfeng in http://bugs.debian.org/385896
> Follow-up Comment #1:
>
> Prefixing the expansion of {} with ./ is a security feature.  I'm not
> planning to remove it.
>
> However, as Andreas points out the actual bug here is that arguments
> containing {} are prefixed with ./ at the start of the argument, even if
the
> {} is not at the start of the argument.   Example:
>
>
> $ find baz -execdir echo 'foo {}' \;
> ./foo baz
Here we need a little more consideration. Thinking about this situation:

Under current directory exists some file whose name looks like `bashrc',
and I want to rename it to `.bashrc', so I would probably run:

$ find . -name "[^.]*rc" -execdir mv {} .{} \;

According to patch file sv-bug-17782.patch, this will result in a command
like `mv ./bashrc ../bashrc', which is definitely not expected.

As a compromise, I suggest to provide an option, say `-suppress_prefix',
to disable this feature for those who really don't need it with -execdir,
while enable it by default for the general purpose invokation.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?17782>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





reply via email to

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