directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 56834 - incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc
Date Sun, 07 Nov 2004 10:20:02 GMT
Author: akarasulu
Date: Sun Nov  7 02:20:02 2004
New Revision: 56834

Modified:
   incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
Log:
tests are all green now jsut need to cleanup

Modified: incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
==============================================================================
--- incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
(original)
+++ incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
Sun Nov  7 02:20:02 2004
@@ -72,8 +72,6 @@
     private final Hashtable env;
     /** a handle on the top initial context: get new context from this */
     private InitialDirContext ctx;
-    /** the search scope to use for reading entries */
-    private int searchScope = SearchControls.SUBTREE_SCOPE;
     /** the search base relative to provider URL to use for reading entries */
     private Name searchBaseDn;
 
@@ -194,7 +192,7 @@
                 ldifParser.parse( attributes, ldif );
                 String dn = ( String ) attributes.remove( "dn" ).get();
 
-                if ( attributes.get( "krb5KDCEntry" ) != null )
+                if ( attributes.get( "objectClass" ).contains( "krb5KDCEntry" ) )
                 {
                     String pw = ( String ) attributes.get( "userpassword" ).get();
                     String krbPrincipal = ( String ) attributes.get( PRINCIPAL_ATTR ).get();
@@ -283,33 +281,12 @@
             return null;
         }
 
-        try
-        {
-            NamingEnumeration list = ctx.list( searchBaseDn );
-            while ( list.hasMore() )
-            {
-                NameClassPair pair = ( NameClassPair ) list.next();
-                System.out.println( pair.getName() );
-            }
-        }
-        catch ( NamingException e )
-        {
-            e.printStackTrace();
-        }
-
-        StringBuffer filter = new StringBuffer();
-        filter.append( "(" );
-        filter.append( PRINCIPAL_ATTR );
-        filter.append( '=' );
-        filter.append( principal.getName() );
-        filter.append( ")" );
-        SearchControls ctrls = new SearchControls();
-        ctrls.setSearchScope( searchScope );
-
+        Attributes attributes = new LockableAttributesImpl();
+        attributes.put( PRINCIPAL_ATTR, principal.getName() );
         try
         {
             Attributes attrs = null;
-            NamingEnumeration list = ctx.search( searchBaseDn, filter.toString(), ctrls );
+            NamingEnumeration list = ctx.search( searchBaseDn, attributes );
             if ( list.hasMore() )
             {
                 SearchResult result = ( SearchResult ) list.next();

Mime
View raw message