escaping semicolon

Ethan Galstad nagios at nagios.org
Thu Mar 23 02:04:28 CET 2006


On 23 Mar 2006 at 1:51, Andreas Ericsson wrote:

> 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.

Either I missed an earlier post, or I've been drinking funny juice 
lately.  I wasn't aware there was a race condition in the macro 
processing.  Can you provide more details?

> 
> 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.
> 


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org



-------------------------------------------------------
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