Custom Object Variables: Contrary to docs, /* custom variable values get cleaned */

Thomas Guyot-Sionnest dermoth at aei.ca
Mon Aug 30 07:39:13 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10-08-28 11:30 AM, "Peter Valdemar Mørch (Lists)" wrote:
> On 2010-08-28 15:59, Ethan Galstad egalstad-at-nagios.org |Lists/Send to 
> lists| wrote:
>> Thanks for pointing this discrepancy out. Custom macros should be
>> cleaned IMO, so I opted to update the docs instead. :-)
> 
> Could this please be a configuration option then? Sometimes there are 
> things that need to contain these characters.
> 
> - Windows services and shares sometimes actually have a $ in them
> - Passwords can have special chars in them (that is even encouraged)
> - The empty string is not representable because ' and " are illegal.
> 
> The reason I hunted the discrepancy down is that we have a need for the 
> special chars, e.g. for the things above.
> 
> Or, instead of simply removing them, would it be possible to 
> backslash-escape them? That way they won't be dangerous any longer.
> 
> Hoping for a config option or other good solution,
> 
> Peter

FWIW there are different kind of cleansing and encoding for macros, and
I think we would have the best of both worlds if we could configure
them, either trough an option mask or using specific prefixes.

just to give some ideas...

__NONE_SOME_MACRO This macro gets no option

__CLEAN__ESCAPE_ANOTHER_MACRO This macro gets cleaned & escaped

__URL_SOME_OTHER_MACRO http://example.com/foo&param=This url gets
url-encoded

Or if we want to apply properties...
_SOME_MACRO This macros will get no option
__PROPS_SOME_MACRO n

_ANOTHER_MACRO This macro will get cleaned & escaped
__PROPS_ANOTHER_MACRO c,e

_SOME_OTHER_MACRO http://example.com/foo&param=This url will get url-encoded
__PROPS_SOME_OTHER_MACRO u

The devault props could also figure in nagios.cfg, or be defined in a
template with __PROPS alone...

- -- 
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx7Q/sACgkQ6dZ+Kt5BchahZgCfR+rf5FrZu2FmWB+E9YYcN/UB
zPcAoLROhtmbIw0t8GAxhk8u8gQKhPM9
=k7pG
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list