[Shinken-devel] Incorrect parsing of variables in resources.cfg when variable contains "=" characte
Status: Beta
Brought to you by:
naparuba
From: Etienne O. <eti...@dd...> - 2011-08-10 13:48:41
|
Hi, We found a (minor) limit case when using variables containing LDAP credentials in resources.cfg : We have a $DOMAINUSER$ variable of the form $DOMAINUSER$=CN=xxxx,OU=xxxx,dc=xxx When using this variable for launching commands, we found that the variable was only substitued with "CN". Investigating a bit further, we found the culprit in config.py, function load_params : each line of the config file was parsed with "=" being the separator char (with elt.split("="), around line 338) to get on one hand the variable name, and on the other hand the variable content. When parsing a value with "=" in it, the string was split in more components, so what was after the second "=" was lost. By modifying elt.split('=') to elt.split('=',1) We ensured that our variable was getting the correct content. So far (one day after), we didn't experience any side effect regarding to this modification. Did it happen to anyone else? Is there a way to correctly parse the variable content without modifying the actual code? Or should we submit a proper patch? Best regards, Etienne Obriot |