mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Added LDAP_LOG messages
This commit is contained in:
parent
bb38d574ac
commit
5f466ae128
@ -37,16 +37,26 @@ bdb_delete(
|
|||||||
DB_LOCK lock;
|
DB_LOCK lock;
|
||||||
#endif
|
#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",
|
Debug( LDAP_DEBUG_ARGS, "==> bdb_delete: %s\n",
|
||||||
dn->bv_val, 0, 0 );
|
dn->bv_val, 0, 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( 0 ) {
|
if( 0 ) {
|
||||||
retry: /* transaction retry */
|
retry: /* transaction retry */
|
||||||
if( e != NULL ) {
|
if( e != NULL ) {
|
||||||
bdb_cache_return_entry_w(&bdb->bi_cache, e);
|
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",
|
Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n",
|
||||||
0, 0, 0 );
|
0, 0, 0 );
|
||||||
|
#endif
|
||||||
rc = TXN_ABORT( ltid );
|
rc = TXN_ABORT( ltid );
|
||||||
ltid = NULL;
|
ltid = NULL;
|
||||||
op->o_private = NULL;
|
op->o_private = NULL;
|
||||||
@ -63,9 +73,15 @@ retry: /* transaction retry */
|
|||||||
bdb->bi_db_opflags );
|
bdb->bi_db_opflags );
|
||||||
text = NULL;
|
text = NULL;
|
||||||
if( rc != 0 ) {
|
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,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"bdb_delete: txn_begin failed: %s (%d)\n",
|
"bdb_delete: txn_begin failed: %s (%d)\n",
|
||||||
db_strerror(rc), rc, 0 );
|
db_strerror(rc), rc, 0 );
|
||||||
|
#endif
|
||||||
rc = LDAP_OTHER;
|
rc = LDAP_OTHER;
|
||||||
text = "internal error";
|
text = "internal error";
|
||||||
goto return_results;
|
goto return_results;
|
||||||
@ -110,9 +126,14 @@ retry: /* transaction retry */
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( p == NULL) {
|
if( p == NULL) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
|
||||||
|
"<=- bdb_delete: parent does not exist\n" ));
|
||||||
|
#else
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"<=- bdb_delete: parent does not exist\n",
|
"<=- bdb_delete: parent does not exist\n",
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
#endif
|
||||||
rc = LDAP_OTHER;
|
rc = LDAP_OTHER;
|
||||||
text = "could not locate parent of entry";
|
text = "could not locate parent of entry";
|
||||||
goto return_results;
|
goto return_results;
|
||||||
@ -132,9 +153,14 @@ retry: /* transaction retry */
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !rc ) {
|
if ( !rc ) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
|
||||||
|
"<=- bdb_delete: no access to parent\n" ));
|
||||||
|
#else
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"<=- bdb_delete: no access to parent\n",
|
"<=- bdb_delete: no access to parent\n",
|
||||||
0, 0, 0 );
|
0, 0, 0 );
|
||||||
|
#endif
|
||||||
rc = LDAP_INSUFFICIENT_ACCESS;
|
rc = LDAP_INSUFFICIENT_ACCESS;
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
@ -158,17 +184,27 @@ retry: /* transaction retry */
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !rc ) {
|
if ( !rc ) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
|
||||||
|
"<=- bdb_delete: no access to parent\n" ));
|
||||||
|
#else
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"<=- bdb_delete: no access "
|
"<=- bdb_delete: no access "
|
||||||
"to parent\n", 0, 0, 0 );
|
"to parent\n", 0, 0, 0 );
|
||||||
|
#endif
|
||||||
rc = LDAP_INSUFFICIENT_ACCESS;
|
rc = LDAP_INSUFFICIENT_ACCESS;
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
|
||||||
|
"<=- bdb_delete: no parent and not root\n" ));
|
||||||
|
#else
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"<=- bdb_delete: no parent "
|
"<=- bdb_delete: no parent "
|
||||||
"and not root\n", 0, 0, 0);
|
"and not root\n", 0, 0, 0);
|
||||||
|
#endif
|
||||||
rc = LDAP_INSUFFICIENT_ACCESS;
|
rc = LDAP_INSUFFICIENT_ACCESS;
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
@ -205,9 +241,15 @@ retry: /* transaction retry */
|
|||||||
char *matched_dn = NULL;
|
char *matched_dn = NULL;
|
||||||
BerVarray refs;
|
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,
|
Debug( LDAP_DEBUG_ARGS,
|
||||||
"<=- bdb_delete: no such object %s\n",
|
"<=- bdb_delete: no such object %s\n",
|
||||||
dn->bv_val, 0, 0);
|
dn->bv_val, 0, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( matched != NULL ) {
|
if ( matched != NULL ) {
|
||||||
matched_dn = ch_strdup( matched->e_dn );
|
matched_dn = ch_strdup( matched->e_dn );
|
||||||
@ -237,9 +279,14 @@ retry: /* transaction retry */
|
|||||||
BerVarray refs = get_entry_referrals( be,
|
BerVarray refs = get_entry_referrals( be,
|
||||||
conn, op, e );
|
conn, op, e );
|
||||||
|
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
|
||||||
|
"<=- bdb_delete: entry is referral\n" ));
|
||||||
|
#else
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"bdb_delete: entry is referral\n",
|
"bdb_delete: entry is referral\n",
|
||||||
0, 0, 0 );
|
0, 0, 0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
send_ldap_result( conn, op, LDAP_REFERRAL,
|
send_ldap_result( conn, op, LDAP_REFERRAL,
|
||||||
e->e_dn, NULL, refs, NULL );
|
e->e_dn, NULL, refs, NULL );
|
||||||
@ -257,16 +304,28 @@ retry: /* transaction retry */
|
|||||||
case DB_LOCK_NOTGRANTED:
|
case DB_LOCK_NOTGRANTED:
|
||||||
goto retry;
|
goto retry;
|
||||||
case 0:
|
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,
|
Debug(LDAP_DEBUG_ARGS,
|
||||||
"<=- bdb_delete: non-leaf %s\n",
|
"<=- bdb_delete: non-leaf %s\n",
|
||||||
dn->bv_val, 0, 0);
|
dn->bv_val, 0, 0);
|
||||||
|
#endif
|
||||||
rc = LDAP_NOT_ALLOWED_ON_NONLEAF;
|
rc = LDAP_NOT_ALLOWED_ON_NONLEAF;
|
||||||
text = "subtree delete not supported";
|
text = "subtree delete not supported";
|
||||||
break;
|
break;
|
||||||
default:
|
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,
|
Debug(LDAP_DEBUG_ARGS,
|
||||||
"<=- bdb_delete: has_children failed: %s (%d)\n",
|
"<=- bdb_delete: has_children failed: %s (%d)\n",
|
||||||
db_strerror(rc), rc, 0 );
|
db_strerror(rc), rc, 0 );
|
||||||
|
#endif
|
||||||
rc = LDAP_OTHER;
|
rc = LDAP_OTHER;
|
||||||
text = "internal error";
|
text = "internal error";
|
||||||
}
|
}
|
||||||
@ -283,9 +342,15 @@ retry: /* transaction retry */
|
|||||||
default:
|
default:
|
||||||
rc = LDAP_OTHER;
|
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,
|
Debug(LDAP_DEBUG_ARGS,
|
||||||
"<=- bdb_delete: dn2id failed: %s (%d)\n",
|
"<=- bdb_delete: dn2id failed: %s (%d)\n",
|
||||||
db_strerror(rc), rc, 0 );
|
db_strerror(rc), rc, 0 );
|
||||||
|
#endif
|
||||||
text = "DN index delete failed";
|
text = "DN index delete failed";
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
@ -300,9 +365,15 @@ retry: /* transaction retry */
|
|||||||
default:
|
default:
|
||||||
rc = LDAP_OTHER;
|
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,
|
Debug(LDAP_DEBUG_ARGS,
|
||||||
"<=- bdb_delete: id2entry failed: %s (%d)\n",
|
"<=- bdb_delete: id2entry failed: %s (%d)\n",
|
||||||
db_strerror(rc), rc, 0 );
|
db_strerror(rc), rc, 0 );
|
||||||
|
#endif
|
||||||
text = "entry delete failed";
|
text = "entry delete failed";
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
@ -317,8 +388,13 @@ retry: /* transaction retry */
|
|||||||
default:
|
default:
|
||||||
rc = LDAP_OTHER;
|
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",
|
Debug( LDAP_DEBUG_ANY, "entry index delete failed!\n",
|
||||||
0, 0, 0 );
|
0, 0, 0 );
|
||||||
|
#endif
|
||||||
text = "entry index delete failed";
|
text = "entry index delete failed";
|
||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
@ -340,18 +416,32 @@ retry: /* transaction retry */
|
|||||||
op->o_private = NULL;
|
op->o_private = NULL;
|
||||||
|
|
||||||
if( rc != 0 ) {
|
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,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"bdb_delete: txn_%s failed: %s (%d)\n",
|
"bdb_delete: txn_%s failed: %s (%d)\n",
|
||||||
op->o_noop ? "abort (no-op)" : "commit",
|
op->o_noop ? "abort (no-op)" : "commit",
|
||||||
db_strerror(rc), rc );
|
db_strerror(rc), rc );
|
||||||
|
#endif
|
||||||
rc = LDAP_OTHER;
|
rc = LDAP_OTHER;
|
||||||
text = "commit failed";
|
text = "commit failed";
|
||||||
|
|
||||||
} else {
|
} 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,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
|
"bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
|
||||||
op->o_noop ? " (no-op)" : "",
|
op->o_noop ? " (no-op)" : "",
|
||||||
e->e_id, e->e_dn );
|
e->e_id, e->e_dn );
|
||||||
|
#endif
|
||||||
rc = LDAP_SUCCESS;
|
rc = LDAP_SUCCESS;
|
||||||
text = NULL;
|
text = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user