]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/suffixalias.c
Experiment with busy loop protection...
[openldap] / servers / slapd / suffixalias.c
index 2e4120e8ddbb3fa5d4a69c18747c2bd3f15bd0a5..703d90ef8275330cbe983de12e90f2959cb160e5 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1999-2000 The OpenLDAP Foundation, All Rights Reserved.
  *
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file in the top level
  * directory of this package.
@@ -32,7 +32,7 @@ char *suffix_alias(
        Backend *be,
        char *dn )
 {
-       int     i, dnLength;
+       int     i, dnLength;
 
        if(dn == NULL) return NULL;
        if(be == NULL) return dn;
@@ -50,7 +50,7 @@ char *suffix_alias(
                        /* alias is longer than dn */
                        continue;
                } else if ( diff > 0 ) {
-                       if ( ! DNSEPARATOR(dn[diff-1]) ) {
+                       if ( ! DN_SEPARATOR(dn[diff-1]) ) {
                                /* boundary is not at a DN separator */
                                continue;
                        }
@@ -63,9 +63,16 @@ char *suffix_alias(
                        dn = ch_malloc( diff + strlen(be->be_suffixAlias[i+1]) + 1 );
                        strncpy( dn, oldDN, diff );
                        strcpy( &dn[diff], be->be_suffixAlias[i+1] );
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+                                  "suffix_alias: converted \"%s\" to \"%s\"\n",
+                                  oldDN, dn ));
+#else
                        Debug( LDAP_DEBUG_ARGS,
                                "suffix_alias: converted \"%s\" to \"%s\"\n",
                                oldDN, dn, 0);
+#endif
+
                        free (oldDN);
                        break;
                }