Hi,

 

@nap i thought you were on the beach.. J

I fixed the split, but forgot to add Etienne to the thanks file.

 

Gerhard

 

Von: nap [mailto:napar...@gmail.com] 
Gesendet: Mittwoch, 10. August 2011 16:07
An: shinken-devel@lists.sourceforge.net
Betreff: Re: [Shinken-devel] Incorrect parsing of variables in resources.cfg
when variable contains "=" character

 

 

On Wed, Aug 10, 2011 at 2:11 PM, Etienne OBRIOT <etienne.obr...@ddblink.fr>
wrote:

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?

 

Hi,

It's a bug :)
I don't think it's possible to bypass it in the current code.

Thanks for hunting it. I'll put the fix (and welcome in the THANKS file :)
). 


Jean

 

Best regards,

 

Etienne Obriot





----------------------------------------------------------------------------
--
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

 

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to