[Freeipa-devel] [PATCH] fix user.getValue()

Kevin McCarthy kmccarth at redhat.com
Tue Aug 14 00:13:28 UTC 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20070813/9b6b8609/attachment.bin>


More information about the Freeipa-devel mailing list