]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/entry.c
don't send error with back-meta
[openldap] / servers / slapd / back-ldbm / entry.c
index a3f15e7771889151186a98772505d49c7ad2be9d..874d8ccbaad604a114ce212eeb534ec055d0cfaf 100644 (file)
@@ -1,8 +1,17 @@
 /* entry.c - ldbm backend entry_release routine */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2006 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #include "portable.h"
@@ -43,6 +52,10 @@ ldbm_back_entry_release_rw(
 #endif
 
        } else {
+               if ( e->e_private ) {
+                       free( e->e_private );
+                       e->e_private = NULL;
+               }
                entry_free( e );
        }
 
@@ -64,82 +77,48 @@ int ldbm_back_entry_get(
        int     rc;
        const char *at_name = at ? at->ad_cname.bv_val : "(null)";
 
-#ifdef NEW_LOGGING
-       LDAP_LOG( BACK_LDBM, ARGS, 
-               "ldbm_back_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 );
-       LDAP_LOG( BACK_LDBM, ARGS, 
-               "ldbm_back_entry_get: oc: \"%s\", at: \"%s\"\n",
-               oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
-#else
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 ); 
        Debug( LDAP_DEBUG_ARGS,
                "=> ldbm_back_entry_get: oc: \"%s\", at: \"%s\"\n",
                oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
-#endif
 
        /* don't grab the giant lock - our caller has already gotten it. */
 
        /* can we find entry */
        e = dn2entry_rw( op->o_bd, ndn, NULL, rw );
        if (e == NULL) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( BACK_LDBM, INFO, 
-                       "ldbm_back_entry_get: cannot find entry (%s)\n", 
-                       ndn->bv_val, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ACL,
                        "=> ldbm_back_entry_get: cannot find entry: \"%s\"\n",
                                ndn->bv_val, 0, 0 ); 
-#endif
                return LDAP_NO_SUCH_OBJECT; 
        }
        
-#ifdef NEW_LOGGING
-       LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_entry_get: found entry (%s)\n",
-               ndn->bv_val, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ACL,
                "=> ldbm_back_entry_get: found entry: \"%s\"\n",
                ndn->bv_val, 0, 0 ); 
-#endif
 
 #ifdef BDB_ALIASES
        /* find attribute values */
        if( is_entry_alias( e ) ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( BACK_LDBM, INFO, 
-                       "ldbm_back_entry_get: entry (%s) is an alias\n", e->e_name.bv_val, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_entry_get: entry is an alias\n", 0, 0, 0 );
-#endif
                rc = LDAP_ALIAS_PROBLEM;
                goto return_results;
        }
 #endif
 
        if( is_entry_referral( e ) ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( BACK_LDBM, INFO, 
-                       "ldbm_back_entry_get: entry (%s) is a referral.\n", e->e_name.bv_val, 0, 0);
-#else
                Debug( LDAP_DEBUG_ACL,
                        "<= ldbm_back_entry_get: entry is a referral\n", 0, 0, 0 );
-#endif
                rc = LDAP_REFERRAL;
                goto return_results;
        }
 
        if ( oc && !is_entry_objectclass( e, oc, 0 )) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( BACK_LDBM, INFO, 
-                       "ldbm_back_entry_get: failed to find objectClass.\n", 0, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ACL,
-                       "<= ldbm_back_entry_get: failed to find objectClass\n",
-                       0, 0, 0 ); 
-#endif
+                       "<= ldbm_back_entry_get: failed to find objectClass %s\n",
+                       oc->soc_cname.bv_val, 0, 0 ); 
                rc = LDAP_NO_SUCH_ATTRIBUTE;
                goto return_results;
        }
@@ -154,12 +133,8 @@ return_results:
                *ent = e;
        }
 
-#ifdef NEW_LOGGING
-       LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_entry_get: rc=%d\n", rc, 0, 0 );
-#else
        Debug( LDAP_DEBUG_TRACE,
                "ldbm_back_entry_get: rc=%d\n",
                rc, 0, 0 ); 
-#endif
        return(rc);
 }