Re: [Nagios-devel] Custom Object Variables: Contrary to docs, /* custom variable values get cleaned
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: Thomas Guyot-S. <de...@ae...> - 2010-08-30 05:39:21
|
-----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¶m=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¶m=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----- |