Page 1 of 1

Re: [Nagios-devel] escaping semicolon

Posted: Wed Mar 22, 2006 4:51 pm
by Guest
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 [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]