escaping semicolon

Andreas Ericsson ae at op5.se
Thu Mar 23 01:51:08 CET 2006


Gerd Mueller wrote:
> Hi all,
> 
> 
> 
> I thought of writing a patch to quote semicolons with a backslash
>  or even better to convert hex to ascii (like \xEB for a semicolon).
>  It was very simple but did not work with NRPE :-(. NRPE has its
>  own nasty characters. So escaping inside nagios config will not
>  be enough :-(.  So I am thinking of "global" solution of escaping
>  nasty characters inside nagios. 
> 
> 
> 
> Anybody any suggestion about a better pattern to escape nasty characters?
>  

Don't escape them at all, but parse out the string using shell-style 
parsing and run the command with execve(2). This will also save us the 
problem of the macro_x locking race that can sometimes occur, making 
Nagios 2 sometimes crash on FreeBSD.

This will do funny things for people who use shell-variables in 
command-lines though, so it's a double-edged sword, but imo sharper on 
the good side.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642




More information about the Developers mailing list