DB_LOCK lock;
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "==>bdb_modrdn(%s,%s,%s)\n",
- dn->bv_val,newrdn->bv_val,
- newSuperior ? newSuperior->bv_val : "NULL" ));
+ LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n",
+ dn->bv_val,newrdn->bv_val, newSuperior ? newSuperior->bv_val : "NULL" );
#else
Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n",
dn->bv_val, newrdn->bv_val,
bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: retrying...\n"));
+ LDAP_LOG ( OPERATION, DETAIL1, "==>bdb_modrdn: retrying...\n", 0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 );
#endif
text = NULL;
if( rc != 0 ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: txn_begin failed: %s (%d)\n", db_strerror(rc), rc ));
+ LDAP_LOG ( OPERATION, ERR,
+ "==>bdb_modrdn: txn_begin failed: %s (%d)\n",
+ db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin failed: %s (%d)\n",
conn, op, e );
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry %s is referral \n", e->e_dn ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: entry %s is referral \n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry %s is referral\n",
e->e_dn, 0, 0 );
if( p == NULL) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: parent does not exist\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "==>bdb_modrdn: parent does not exist\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent does not exist\n",
0, 0, 0);
children, NULL, ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to parent\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
0, 0 );
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to children of entry %s OK\n",
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: parent dn=%s\n",
if ( ! rc )
{
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to parent\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"no access to parent\n",
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to children of entry \"\" OK\n", p_dn.bv_val ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: wr to children of entry \"%s\" OK\n",
+ p_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to children of entry \"\" OK\n",
p_dn.bv_len = 0;
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: parent dn=\"\" \n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: parent dn=\"\" \n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: parent dn=\"\"\n",
} else {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no parent, not root &\"\" is not suffix\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "==>bdb_modrdn: no parent, not root &\"\" is not "
+ "suffix\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: no parent, not root "
if ( newSuperior != NULL ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: new parent \"%s\" requested...\n", newSuperior->bv_val ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: new parent \"%s\" requested...\n",
+ newSuperior->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new parent \"%s\" requested...\n",
if( np == NULL) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: newSup(ndn=%s) not here!\n", np_ndn->bv_val ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: newSup(ndn=%s) not here!\n",
+ np_ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: newSup(ndn=%s) not here!\n",
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", np, (long) np->e_id ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
+ np, (long) np->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
/* check newSuperior for "children" acl */
if ( !access_allowed( be, conn, op, np, children, NULL, ACL_WRITE, NULL ) ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: no wr to newSup children\n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: no wr to newSup children\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: no wr to newSup children\n",
if ( is_entry_alias( np ) ) {
/* parent is an alias, don't allow add */
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry is alias\n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: entry is alias\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is alias\n",
0, 0, 0 );
if ( is_entry_referral( np ) ) {
/* parent is a referral, don't allow add */
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry is referral\n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "==>bdb_modrdn: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is referral\n",
0, 0, 0 );
#endif
- rc = LDAP_OPERATIONS_ERROR;
+ rc = LDAP_OTHER;
goto return_results;
}
if ( ! rc )
{
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to superior\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "==>bdb_modrdn: no access to superior\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"no access to new superior\n",
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: wr to children entry \"\" OK\n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "bdb_modrdn: wr to children entry \"\" OK\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to children of entry \"\" OK\n",
} else {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: new superior=\"\", not root & \"\" is not suffix\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: new superior=\"\", not root & \"\" "
+ "is not suffix\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new superior=\"\", not root "
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: new superior=\"\"\n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "bdb_modrdn: new superior=\"\"\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new superior=\"\"\n",
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: wr to new parent's children OK\n" ));
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "bdb_modrdn: wr to new parent's children OK\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to new parent's children OK\n",
dnNormalize2( NULL, &new_dn, &new_ndn );
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val ));
+ LDAP_LOG ( OPERATION, RESULTS,
+ "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new ndn=%s\n",
new_ndn.bv_val, 0, 0 );
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new ndn=%s does not exist\n",
LDAP_DN_FORMAT_LDAP ) )
{
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out type(s)/values(s) of newrdn\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: can't figure out type(s)/values(s) of newrdn\n",
+ 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: can't figure out type(s)/values(s) "
"of newrdn\n", 0, 0, 0 );
#endif
- rc = LDAP_OPERATIONS_ERROR;
+ rc = LDAP_INVALID_DN_SYNTAX;
text = "unknown type(s) used in RDN";
goto return_results;
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val ));
+ LDAP_LOG ( OPERATION, RESULTS,
+ "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
+ new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
LDAP_DN_FORMAT_LDAP ) )
{
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out type(s)/values(s) of old_rdn\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: can't figure out type(s)/values(s) of old_rdn\n",
+ 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_back_modrdn: can't figure out the old_rdn "
( const char ** )new_rdn_types ) != 0 ) {
/* Not a big deal but we may say something */
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s do not match\n", old_rdn_types[ 0 ], new_rdn_types[ 0 ] ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s do not match\n",
+ old_rdn_types[ 0 ], new_rdn_types[ 0 ], 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s "
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: %s: %s (new)\n", text, new_rdn[0][a_cnt]->la_attr.bv_val ));
+ LDAP_LOG ( OPERATION, ERR, "bdb_modrdn: %s: %s (new)\n",
+ text, new_rdn[0][a_cnt]->la_attr.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: %s: %s (new)\n",
if ( !access_allowed( be, conn, op, e, desc,
&new_rdn[0][ a_cnt ]->la_value, ACL_WRITE, NULL ) ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: access to attr \"%s\" (new) not allowed\n", new_rdn[0][a_cnt]->la_attr.bv_val ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: access to attr \"%s\" (new) not allowed\n",
+ new_rdn[0][a_cnt]->la_attr.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: access to attr \"%s\" "
/* Get value of old rdn */
if ( old_rdn == NULL) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out old RDN values(s) from old RDN\n" ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: can't figure out old RDN values(s) "
+ "from old RDN\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: can't figure out old RDN value(s) "
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: %s: %s (old)\n", text, old_rdn[0][d_cnt]->la_attr.bv_val ));
+ LDAP_LOG ( OPERATION, ERR, "bdb_modrdn: %s: %s (old)\n",
+ text, old_rdn[0][d_cnt]->la_attr.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: %s: %s (old)\n",
if ( !access_allowed( be, conn, op, e, desc,
&old_rdn[0][d_cnt]->la_value, ACL_WRITE, NULL ) ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: access to attr \"%s\" (old) not allowed\n", old_rdn[0][d_cnt]->la_attr.bv_val ));
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modrdn: access to attr \"%s\" (old) not allowed\n",
+ old_rdn[0][d_cnt]->la_attr.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: access to attr \"%s\" "
if( rc == LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ));
+ LDAP_LOG ( OPERATION, RESULTS,
+ "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
+ op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
#else
Debug(LDAP_DEBUG_TRACE,
"bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
} else {
#ifdef NEW_LOGGING
- LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: %s : %s (%d)\n", text, db_strerror(rc), rc ));
+ LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n",
+ text, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n",
text, db_strerror(rc), rc );