]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/dn2entry.c
Set lock detector to DEFAULT, not NORUN.
[openldap] / servers / slapd / back-bdb / dn2entry.c
index b30dce4a23bec04b6e71df1e1d5ce97b4e6cfc21..767c1571dbe85e22ddceedd7b2f75127d39f8742 100644 (file)
@@ -1,7 +1,7 @@
 /* dn2entry.c - routines to deal with the dn2id / id2entry glue */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
 
 int
 bdb_dn2entry(
-    BackendDB  *be,
+       BackendDB       *be,
        DB_TXN *tid,
-    const char *dn,
+       struct berval *dn,
        Entry **e,
-    Entry **matched,
+       Entry **matched,
        int flags )
 {
        int rc;
-       ID              id;
-       char    *matchedDN = NULL;
+       ID              id, id2 = 0;
 
-       Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry: dn: \"%s\"\n",
-               dn, 0, 0 );
+       Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry(\"%s\")\n",
+               dn->bv_val, 0, 0 );
+
+       *e = NULL;
 
        if( matched != NULL ) {
-               rc = bdb_dn2id_matched( be, tid, dn, &id, &matchedDN );
+               *matched = NULL;
+               rc = bdb_dn2id_matched( be, tid, dn, &id, &id2 );
        } else {
                rc = bdb_dn2id( be, tid, dn, &id );
        }
@@ -43,12 +45,11 @@ bdb_dn2entry(
                return rc;
        }
 
-       if( matchedDN == NULL ) {
+       if( id2 == 0 ) {
                rc = bdb_id2entry( be, tid, id, e );
        } else {
-               ch_free( matchedDN );
-               rc = bdb_id2entry( be, tid, id, matched );
+               rc = bdb_id2entry( be, tid, id2, matched );
        }
 
        return rc;
-}
\ No newline at end of file
+}