directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seman...@apache.org
Subject svn commit: r1681745 - /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Tue, 26 May 2015 12:10:26 GMT
Author: semancik
Date: Tue May 26 12:10:25 2015
New Revision: 1681745

URL: http://svn.apache.org/r1681745
Log:
Check if we really need to specify newSuperior in moveAndRename(...)
newSuperior is optional [RFC4511, section 4.9]. Some servers (e.g. OpenDJ 2.6) require a special
privilege if
newSuperior is specified even if it is the same as the old one. Therefore let's not specify
it if we do not need it.
This is better interoperability.

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1681745&r1=1681744&r2=1681745&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Tue May 26 12:10:25 2015
@@ -2625,7 +2625,18 @@ public class LdapNetworkConnection exten
         ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
         modDnRequest.setName( entryDn );
         modDnRequest.setNewRdn( newDn.getRdn() );
-        modDnRequest.setNewSuperior( newDn.getParent() );
+        
+        // Check if we really need to specify newSuperior.
+        // newSuperior is optional [RFC4511, section 4.9]
+        // Some servers (e.g. OpenDJ 2.6) require a special privilege if
+        // newSuperior is specified even if it is the same as the old one. Therefore let's
not
+        // specify it if we do not need it. This is better interoperability. 
+        Dn newDnParent = entryDn.getParent();
+        if ( newDnParent != null && !newDnParent.equals( newDn.getParent() ) )
+        {
+            modDnRequest.setNewSuperior( newDnParent );
+        }
+        
         modDnRequest.setDeleteOldRdn( deleteOldRdn );
 
         ModifyDnResponse modifyDnResponse = modifyDn( modDnRequest );



Mime
View raw message