directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 56893 - incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc
Date Mon, 08 Nov 2004 03:20:52 GMT
Author: akarasulu
Date: Sun Nov  7 19:20:51 2004
New Revision: 56893

Modified:
   incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
Log:
Corrected load from LDIF


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 19:20:51 2004
@@ -172,7 +172,7 @@
 
         // An LDIF must be loaded if this is the first time we're starting
         // otherwise we're done and ready to serve lookup requests
-        if ( ! isFirstStart || ! env.containsKey( KDC_ENTRY_LDIF_FILE ) )
+        if ( ! env.containsKey( KDC_ENTRY_LDIF_FILE ) )
         {
             return;
         }
@@ -201,6 +201,21 @@
                     attributes.put( KEY_ATTR, encodedKey );
                     attributes.put( VERSION_ATTR, Integer.toString( key.getVersionNumber()
) );
                     attributes.put( TYPE_ATTR, Integer.toString( key.getKeyType() ) );
+                }
+
+                try
+                {
+                    if ( ctx.lookup( dn ) == null )
+                    {
+                        System.out.println( "Entry " + dn + " from LDIF exists." );
+                        continue;
+                    }
+                }
+                catch( Exception e )
+                {
+                    System.out.println( "Entry " + dn
+                            + " from LDIF does not exist.  Creating it ..." );
+
                 }
 
                 ctx.createSubcontext( getRelativeName( ctx, dn ), attributes );

Mime
View raw message