[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#4684) Bind Operation Bug



This appears to be a duplicate of ITS#4678, or if not,
certainly closable for the same reasons that ITS#4678
was closed.

Nothing here is indicative of a bug in OpenLDAP Software.
It is merely indicative of a lack of understanding on
the proper use of JDNI, LDAP, and/or slapd(8).  Debugging
your JNDI code (or JNDI itself) is far beyond the scope
of this list.

If you believe you have found a bug in slapd(8), illustrate
the bug using OpenLDAP command line tools and/or slapd(8)
log messages.

This report will be closed.

Kurt


At 11:15 AM 9/22/2006, dvohra09@yahoo.com wrote:
>Full_Name: Deepak Vohra
>Version: 
>OS: 
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (207.6.39.2)
>
>
>The bind operation generates an exception if the cn has a space, 
>for example cn=john smith.
>javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 
>no global
>> superior knowledge]; 
>
>If a cn does not have a space in it, for example cn=johnsmith, an exception does
>not get generated.
>
>
>
>import javax.naming.Context;
>import javax.naming.InitialContext;
>import javax.naming.NamingException;
>import javax.naming.NameAlreadyBoundException;
>import javax.naming.directory.*;
>import java.util.*;
>
>public class TestLDAP {
>        final static String ldapServerName = "localhost";
>        final static String rootdn = "cn=Manager,dc=example,dc=com";
>        final static String rootpass = "";
>        final static String rootContext = "cn=john smith, dc=example,dc=com";
>        
>        public static void main( String[] args ) {
>                // set up environment to access the server
>                
>                Properties env = new Properties();
>                
>                env.put( Context.INITIAL_CONTEXT_FACTORY,
>                         "com.sun.jndi.ldap.LdapCtxFactory" );
>                env.put( Context.PROVIDER_URL, "ldap://"; + ldapServerName +
>"/");
>                env.put( Context.SECURITY_PRINCIPAL, rootdn );
>                env.put( Context.SECURITY_CREDENTIALS, rootpass );
>                
>                try {
>                        // obtain initial directory context using the
>environment
>                        DirContext ctx = new InitialDirContext( env );
>                        
>                        // create some random number to add to the directory
>                        Integer i = new Integer( 28420 );
>                        
>                        System.out.println( "Adding " + i + " to directory..."
>);
>                        ctx.bind("cn=myRandomInt,cn=john smith,
>dc=example,dc=com", i );
>                        
>                        i = new Integer( 98765 );
>                        System.out.println( "i is now: " + i );
>                        
>                        i = (Integer) ctx.lookup(
>"cn=myRandomInt,cn=bharathgowda, dc=example,dc=com" );
>                        System.out.println( "Retrieved i from directory with
>value: " + i );
>                } catch ( NameAlreadyBoundException nabe ) {
>                        System.err.println( "value has already been bound!" );
>                } catch ( Exception e ) {
>                        System.err.println( e );
>                }
>        }
>}