httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Reder" <rede...@remulak.net>
Subject Question about command parsing in mod_ext_filter.
Date Mon, 19 Aug 2002 20:31:21 GMT
After fixing the parse_cmd code to be able to handle escaped quotes (so that
it would process the full
          <"/bin/awk '{print NR\": \" $N}'">
instead of just
          <"/bin/awk '{print NR\">
(and then an error for the <: \" $N}'"> part)) I ran into what appears to be
the next problem.

In parse_cmd it runs

         /* parms now has the command-line to parse */
         while (filter->numArgs < 30 &&
                strlen(filter->args[filter->numArgs] = ap_getword_white_nc(p, &parms)))
{
             ++filter->numArgs;
         }

to break the command string into an args list of tokens. This code uses *only* white
space as delimeters. Thus the input command string
          "/bin/awk '{print NR\": \" $N}'"

gets broken into
           /bin/awk
           '{print
           NR\":
           \"
           $N}'

The question I have is, shouldn't this break down into either
           /bin/awk
           '{print NR\": \" $N}'
or
           /bin/awk
           '{print NR\
           ": \"
           $N}'

The above listed pieces end up as the args list passed on the apr_proc_create
call.


Thanks,

-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein



Mime
View raw message