[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with relaying

On Wed, 17 Jan 2001, Matti Aarnio spake thusly:
>    The script-language in the router is very much SH like, thus
> 	varname=$expression
>    is not same as:
> 	varname="$expression"
>    The second one guarantes that the expression result is single string,
>    even when it contains various shell metachars.
>    Hmm..  I wonder if there really are situations where the classical SH
>    style expansions makes sense -- IFS splitting of unquoted string expands
>    to tokens, and then analysing for SH metachars.

Well, it's all about parsing. If it's done correctly it's ok, if it
isn't and the parser is exposed to the net it's really bad. Moreover shell-like
languages encourage bad programming habits (like the above-mentioned unquoted
strings). CGI programmers learned long ago not to use /bin/*sh for this very
reason (not all of them of course;)

>    Changeing the script interpret is one of the most difficult things
>    in ZMailer, and this evaluator detail doubly so...  I recall having
>    tried and failed.  Small tweaking there isn't simple, a thorough
>    underlying script-language replacement might be easier, but which ?
>    PERL ?  Python ?  TCL ?  Scheme ?

For the sake of parser simplicity Scheme is the obvious choice. Guile as modern
and well-maintained Scheme implementation comes to mind. Embedding guile in
router wouldn't be hard, I think. I don't know about the API bindings
though. Existing router scripts would require compatibility mode of course.

Changing the meaning of $varname to "$varname" is a good idea. I don't think it
can break anything. But I don't have any examples of sensible $varname usage