Issue #197 has been updated by Jonathan Clarke.

File patch added

This is due to different methods being used to get the DN from the source and 
from the destination.

Both use a SearchEntry object, but the source connector calls 
"getNameInNamespace()":http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/NameClassPair.html#getNameInNamespace(),
 while the destination connector calls 
"getName()":http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/NameClassPair.html#getName().
 The second seems to escape characters differently... There's a related bug in 
Sun's bugtracker: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6567865

The main difference in behavior between the two is that *getNameInNamespace()* 
returns the full DN (eg, _cn=Elevator#2,ou=Subscribers,dc=example,dc=com_) 
whereas *getName()* returns just the relative name compared to the search base 
(eg _cn=Elevator#2_). So, we can't just replace one with the other in 
*LscBean.getInstance(*), because then we'd be carrying around the full DN 
instead of a relative DN...

So we need to use *getNameInNamespace()* and "chop off" the irrelevant bits 
components of the DN that follow (search baseDN (maybe null/empty) and context 
DN). But if the search baseDN is null/empty, we don't know where to "chop", 
since we don't have the context DN here...

Attached is a patch for reflexion. It uses *getNameInNamespace()* when 
possible, but falls back to *getName()* otherwise... This is not satisfactory 
but food for thought. Any ideas around?
----------------------------------------
Bug #197: Problem with DN that has a # sign
http://tools.lsc-project.org/issues/show/197

Author: Samuel Tran
Status: New
Priority: High
Assigned to: Sébastien Bahloul
Category: Core
Target version: 1.2.0


I have installed LSC 1.2 using the snapshot lsc-core-1.2-SNAPSHOT-dist.tar.gz 
from 04/14/2010 on CentOS Linux 5.4.
I want to synchronize two OpenLDAP Directories: the source directory is 
OpenLDAP 2.3.x and the destination is OpenLDAP 2.4.x.

Some DNs in the source directory have a # sign, e.g:

dn: cn=Elevator#2,ou=Subscribers,dc=example,dc=com
objectClass: inetOrgPerson
givenName: Elevator
uid: Elevator#2
cn: Elevator#2
sn: #2

My LSC synchronization is as follows:
lsc.syncoptions.MySyncTask = 
org.lsc.beans.syncoptions.PropertiesBasedSyncOptions
lsc.syncoptions.MySyncTask.default.action = F

When I first ran lsc, it created all the DNs in the destination directory. Then 
I ran it again. Even though no changes were made in the source directory, it 
tries to rename the DNs with a # sign. For instance it tries to rename 
'cn=Elevator#2,ou=Subscribers,dc=example,dc=com'; here is the ouput of the lcs 
run:

Apr 15 15:10:28 - WARN  - WARNING: updating the RDN of the entry will cancel 
other modifications! Relaunch synchronization to complete update.
Apr 15 15:10:28 - INFO  - # Renaming entry cn=Elevator\#2,ou=TelecomAssets for 
MySyncTask
dn: cn=Elevator\#2,ou=TelecomAssets,dc=example,dc=com
changetype: modrdn
newrdn: ou=TelecomAssets
deleteoldrdn: 1
newsuperior: cn=Elevator\#2

Then I ran lsc for a third time, the DN was not renamed and I still got the 
same error message.
I guess lsc is escaping the # sign with a backslash, which is causing that 
problem.

Thanks for your help.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://tools.lsc-project.org/my/account
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-dev mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-dev

Reply via email to