[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [PATCH 5.005_63 IO] Avoid shelling on backwhacks



Simon Cozens writes:
> 
> I'm not sure about this one. I'm really not sure about this one.
> Somebody will find a clever way of breaking it, no doubt, but it
> might be useful.
> 
> As you know, pp_exec calls out to the shell when it sees
> any shell metacharacters. One of those characters in the list is
> the backslash. However, I'm not sure the presence of a backslash
> a good reason to shell - the only thing the shell is going to do (if
> I've got this right) is to escape the following character.

Or not escape it.  Depending on a phase of the moon on DOSISH systems,
where SH-ish shells may decide to live \a to mean \\a to facilitate
usage of DOSISH paths (surprizingly, the only thing I know which is
broken by this option in OS/2 pdksh is one subtest in the Perl test
suite ;-).

> Well, we can do that ourselves.

In fact, I have a tiny 75%-completed parser which recognizes and
parses command lines where the only shell metachars are used in
purpose of delimiting arguments.  (Anybody interesting to finish
this?)  But in fact backwacks are one of the things I decided I will
leave to shell.

What is your motivation?  Why you consider unbackwacking an important
case to optimize?

Ilya


References to:
simon@brecon.co.uk (Simon Cozens)

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]