[lsc-dev] %20 to space conversion in LSC 1.2/1.3 to support clean phase

Jonathan Clarke jonathan at phillipoux.net
Tue Sep 21 16:34:55 CEST 2010


Hi,

On 20/09/2010 20:08, Sebastien Bahloul wrote:
> Hi guys,
>
> Here is a simple patch to include a wrapper for "%20" to " " in base context
> name. If not included, context dn including "%20" are not wrapped correctly
> and try to delete the entry through it's full dn (dawn jndi !)
>
> Before commiting it, does someone have any comment about this crappy patch ?

Sure, I have some comments on the patch, thanks for posting it :)

But first, why is there not a bug open on this subject? It clearly looks 
like a bug to me (especially if it causes entries to be deleted 
wrongly!). I already asked Quentin several times to create one on IRC. 
This bug is actually related to a fix I wrote recently (see bug #209). 
If I had seen a bug report I could have fixed it long ago...

So, about the patch, a few comments:
- Replacing "%20" is not sufficient - there are many special characters 
that are encoded in LDAP URLs, which all need to be decoded for this 
comparison to take place.
- The contextDN attribute is used similarly in other places in the 
JndiServices class - you would need to patch those too, but I think this 
patch is in the wrong place.

I didn't see a test in your patch, which would be nice to understand 
what's actually happening, and make sure we don't break it in the 
future. I attach a possible test, can you confirm this is indeed the 
issue you have?

If so, there is no problem in 1.3 branch or trunk according to this 
test. I attach a proposed patch to fix the issue in 1.2 (basically a 
backport from 1.3/trunk). Does that work for you?

Jonathan
-- 
--------------------------------------------------------------
Jonathan Clarke - jonathan at phillipoux.net
--------------------------------------------------------------
Ldap Synchronization Connector (LSC) - http://lsc-project.org
--------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spaceprotected-delete-2.diff
Type: text/x-patch
Size: 1895 bytes
Desc: not available
URL: <http://lists.lsc-project.org/pipermail/lsc-dev/attachments/20100921/5e681d6c/attachment.bin>
-------------- next part --------------
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-dev mailing list
lsc-dev at lists.lsc-project.org
http://lists.lsc-project.org/listinfo/lsc-dev


More information about the lsc-dev mailing list