DB_LOCK lock;
#endif
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ARGS, "==> bdb_delete: %s\n",
+ dn->bv_val ));
+#else
Debug( LDAP_DEBUG_ARGS, "==> bdb_delete: %s\n",
dn->bv_val, 0, 0 );
+#endif
if( 0 ) {
retry: /* transaction retry */
if( e != NULL ) {
bdb_cache_return_entry_w(&bdb->bi_cache, e);
}
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "==> bdb_delete: retrying...\n" ));
+#else
Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n",
0, 0, 0 );
+#endif
rc = TXN_ABORT( ltid );
ltid = NULL;
op->o_private = NULL;
bdb->bi_db_opflags );
text = NULL;
if( rc != 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ERR,
+ "==> bdb_delete: txn_begin failed: %s (%d)\n",
+ db_strerror(rc), rc ));
+#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
+#endif
rc = LDAP_OTHER;
text = "internal error";
goto return_results;
}
if( p == NULL) {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "<=- bdb_delete: parent does not exist\n" ));
+#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: parent does not exist\n",
0, 0, 0);
+#endif
rc = LDAP_OTHER;
text = "could not locate parent of entry";
goto return_results;
}
if ( !rc ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "<=- bdb_delete: no access to parent\n" ));
+#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no access to parent\n",
0, 0, 0 );
+#endif
rc = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
}
}
if ( !rc ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "<=- bdb_delete: no access to parent\n" ));
+#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no access "
"to parent\n", 0, 0, 0 );
+#endif
rc = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
}
} else {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "<=- bdb_delete: no parent and not root\n" ));
+#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no parent "
"and not root\n", 0, 0, 0);
+#endif
rc = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
}
char *matched_dn = NULL;
BerVarray refs;
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ARGS,
+ "<=- bdb_delete: no such object %s\n",
+ dn->bv_val ));
+#else
Debug( LDAP_DEBUG_ARGS,
"<=- bdb_delete: no such object %s\n",
dn->bv_val, 0, 0);
+#endif
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
BerVarray refs = get_entry_referrals( be,
conn, op, e );
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "<=- bdb_delete: entry is referral\n" ));
+#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: entry is referral\n",
0, 0, 0 );
+#endif
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
case DB_LOCK_NOTGRANTED:
goto retry;
case 0:
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
+ "<=- bdb_delete: non-leaf %s\n",
+ dn->bv_val ));
+#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: non-leaf %s\n",
dn->bv_val, 0, 0);
+#endif
rc = LDAP_NOT_ALLOWED_ON_NONLEAF;
text = "subtree delete not supported";
break;
default:
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ERR,
+ "<=- bdb_delete: has_children failed %s (%d)\n",
+ db_strerror(rc), rc ));
+#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: has_children failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
+#endif
rc = LDAP_OTHER;
text = "internal error";
}
default:
rc = LDAP_OTHER;
}
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ERR,
+ "<=- bdb_delete: dn2id failed %s (%d)\n",
+ db_strerror(rc), rc ));
+#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: dn2id failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
+#endif
text = "DN index delete failed";
goto return_results;
}
default:
rc = LDAP_OTHER;
}
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ERR,
+ "<=- bdb_delete: id2entry failed: %s (%d)\n",
+ db_strerror(rc), rc ));
+#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: id2entry failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
+#endif
text = "entry delete failed";
goto return_results;
}
default:
rc = LDAP_OTHER;
}
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ERR,
+ "<=- bdb_delete: entry index delete failed!\n" ));
+#else
Debug( LDAP_DEBUG_ANY, "entry index delete failed!\n",
0, 0, 0 );
+#endif
text = "entry index delete failed";
goto return_results;
}
op->o_private = NULL;
if( rc != 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_ERR,
+ "bdb_delete: txn_%s failed: %s (%d)\n",
+ op->o_noop ? "abort (no-op)" : "commit",
+ db_strerror(rc), rc ));
+#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_%s failed: %s (%d)\n",
op->o_noop ? "abort (no-op)" : "commit",
db_strerror(rc), rc );
+#endif
rc = LDAP_OTHER;
text = "commit failed";
} else {
+#ifdef NEW_LOGGING
+ LDAP_LOG (( "delete", LDAP_LEVEL_RESULTS,
+ "bdb_delete: deleted%s id=%08lx db=\"%s\"\n",
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn ));
+#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn );
+#endif
rc = LDAP_SUCCESS;
text = NULL;
}