[SSSD] [PATCH] INI allow string list to have empty values

Dmitri Pal dpal at redhat.com
Fri Jan 22 15:37:35 UTC 2010


David O'Brien wrote:
> Dmitri Pal wrote:
>   
>> Hello,
>>
>> This patch allows proper parsing of values like this:
>>
>> fruit=apple,,orange
>>
>> The added function would return the list of three items:
>> apple
>> <empty>
>> orange
>>
>> Previously existing parsing functions in this case could only return
>> apple
>> orange
>>
>> This is used in the ELAPI configuration to provide alternative names for
>> the column headers.
>>
>> This is the last of the non ELAPI patche that I have in my repo.
>>
>>
>>     
>
> These two things might be completely unrelated, but having just edited 
> the sssd-ldap man page and the section on failover, I couldn't help but 
> wonder:
> <quote>
>   Failover Syntax
>         The list of servers is given as a comma-separated list; any 
> number of spaces is allowed around the comma.
> </quote>
>
> How would an "accidental" double-comma be handled here? I'm guessing 
> white space is removed wherever it's not needed.
>
> /thoughts from a non-coder  ;-)
>   
The function that was introduced by the patch was created in addition to
the original function that is used in parsing of the configuration.
So the answer as before would be :
a) Spaces will be trimmed
b) Extra commas will be ignored
So no changes here.
When adding a new function I realized that the new function should not
replace the old one since in many cases spaces should be trimmed and
commas ignored.
Only for specific cases when the list has positioned arguments the
double-comma will be treated as two separators with empty value in the
middle.
This is the programmer's choice and so far the only place where it is
used is in ELAPI to give alternative names to CSV or HTML columns.  


-- 
Thank you,
Dmitri Pal

Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




More information about the sssd-devel mailing list