]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/delete.c
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / servers / slapd / delete.c
index 2f9c1a0b0e94fd7042c4f72de08199ec9be479c3..3d0999f0123c4659daf1a57d6bdd232d5ca0d07e 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@ do_delete(
 {
        struct berval dn = BER_BVNULL;
 
-       Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 );
-
+       Debug( LDAP_DEBUG_TRACE, "%s do_delete\n",
+               op->o_log_prefix, 0, 0 );
        /*
         * Parse the delete request.  It looks like this:
         *
@@ -50,43 +50,47 @@ do_delete(
         */
 
        if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) {
-               Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "%s do_delete: ber_scanf failed\n",
+                       op->o_log_prefix, 0, 0 );
                send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
                return SLAPD_DISCONNECT;
        }
 
        if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-               Debug( LDAP_DEBUG_ANY, "do_delete: get_ctrls failed\n", 0, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "%s do_delete: get_ctrls failed\n",
+                       op->o_log_prefix, 0, 0 );
                goto cleanup;
        } 
 
        rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
                op->o_tmpmemctx );
        if( rs->sr_err != LDAP_SUCCESS ) {
-               Debug( LDAP_DEBUG_ANY,
-                       "do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "%s do_delete: invalid dn (%s)\n",
+                       op->o_log_prefix, dn.bv_val, 0 );
                send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
                goto cleanup;
        }
 
+       Statslog( LDAP_DEBUG_STATS, "%s DEL dn=\"%s\"\n",
+               op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
+
        if( op->o_req_ndn.bv_len == 0 ) {
-               Debug( LDAP_DEBUG_ANY, "do_delete: root dse!\n", 0, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "%s do_delete: root dse!\n",
+                       op->o_log_prefix, 0, 0 );
                /* protocolError would likely be a more appropriate error */
                send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
                        "cannot delete the root DSE" );
                goto cleanup;
 
        } else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) {
-               Debug( LDAP_DEBUG_ANY, "do_delete: subschema subentry!\n", 0, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "%s do_delete: subschema subentry!\n",
+                       op->o_log_prefix, 0, 0 );
                /* protocolError would likely be a more appropriate error */
                send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
                        "cannot delete the root DSE" );
                goto cleanup;
        }
 
-       Statslog( LDAP_DEBUG_STATS, "%s DEL dn=\"%s\"\n",
-               op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
-
        op->o_bd = frontendDB;
        rs->sr_err = frontendDB->be_delete( op, rs );