[Freeipa-devel] [PATCH] 971 detect binary LDAP data

Petr Viktorin pviktori at redhat.com
Thu Mar 29 09:20:40 UTC 2012


On 03/29/2012 12:20 AM, Rob Crittenden wrote:
>
> I'm using a much narrower scope. I'm not trying to make it easy to
> manage non-printable characters, just not blow things up if they exist.
> Limiting to the XML-RPC supported set is for convenience, these are
> unprintable characters in any context. This is just a two-fer.

Right. The XML set is a nice compromise when you want to define 
“unprintable characters”.

> Petr was right, I need to encode to unicode before doing this comparison
> in order to compare invalid unicode characters so I moved that first.
>
> I added a very basic unit test.

I suggest the attached additions to the test, to ensure the encoder uses 
contains_non_printable as it should. (PEP8 nitpicks included)

> If you're wondering where this data might come from, two ways are via AD
> sync and migration.
>
> Yes, the user will be left in a situation where they'll need to use
> --setattr or ldapmodify to manage the data in the field. The UI doesn't
> show the value at all but instead shows [object Object] (no errors in
> console, not sure where this is coming from). It is possible to
> highlight this and insert a new value though.

So basically, we don't allow non-printable characters in text fields. 
When they're already there, we display weird data but don't blow up.
I believe that's fine, as long as it's documented.

--setattr won't work: the data won't make it through XML-RPC. (I get 
Internal Server Error currently)

> rob


-- 
Petr³
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extra-tests.diff
Type: text/x-patch
Size: 848 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120329/48f99e0c/attachment.bin>


More information about the Freeipa-devel mailing list