[Freeipa-devel] [PATCH] fix user.getValue()
Rob Crittenden
rcritten at redhat.com
Tue Aug 14 02:33:18 UTC 2007
Kevin McCarthy wrote:
> Andrew Bartlett wrote:
>> On Mon, 2007-08-13 at 09:31 -0400, Rob Crittenden wrote:
>>> Kevin McCarthy wrote:
>>>> I think we should be looking at the value instead of value[0] to
>>>> determine what it is. I stumbled across this bug because I was able to
>>>> submit telephoneNumber as an empty string. The code was blowing up
>>>> trying to do a value[0] on "".
>>>>
>>>> This raises a point about whether we should allow empty strings into
>>>> LDAP. Pete had some points about this, but I'll allow him to state them
>>>> (since I'm not sure I understood them).
>>>>
>>>> -Kevin
>>> I suspect that the proper fix is to not allow empty attributes to be set
>>> in the first place.
>> Empty attributes sounds like a route to pain... Also perhaps ensure
>> admins can't set an attribute to " ".
>
> So should this be filtered out in funcs.py, or should the web (and
> commandline) gui filter out empty fields?
>
> Also, I didn't want it to get lost that the patch I sent should be
> applied regardless of how we filter empty attributes: value is
> either a string or a sequence. It was a bug/typo to check if value[0]
> is an instance of a list or tuple. It just became apparent when
> telephoneNumber was zero-length and we tried to grab value[0] of "".
>
> -Kevin
The marshalling/unmarshalling of data in the XML-RPC connection does odd
things to the data types. I'll see tomorrow if that is the reason for
value[0]. The difference may be that you aren't using the XML-RPC interface.
rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070813/5fdcd798/attachment.bin>
More information about the Freeipa-devel
mailing list