Open xtaran opened 9 years ago
Original reporter here!
For simplicity, I'd suggest keeping ./
prefix iff --print0
is enabled:
--print0
output is not intended for human consumption, so aesthetic arguments against stripping ./
don't apply.--print0
, then argument injection is possible via embedded newlines, regardless of whether you keep ./
or not, so you might as well strip it.
The following has been reported in Debian as #798180 against ack 2.14 and I can still reproduce it with 2.15.01:
The given example can be solved with the GNU-ish
--
as Debian ships GNU Coreutils'rm
command:But this may not work with other commands not providing a GNU-ish
--
option or with a differentrm
implementation, e.g. a BSD-ish one.I do see that stripping a leading
./
from a file's path is a neat feature for human use (I actually like it :-), so I understand if that's considered a feature. In that case, please provide an option to turn that feature off. So far (as of 2.15.01) I haven't found such an option in ack's man page.