]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/bind.c
first step towards removing back-*/external.h
[openldap] / servers / slapd / back-meta / bind.c
index 3eb5f0db6c5007ad69446be291526f7791d1c385..c6aaa87cf38c21f20e14317cb920797902507f84 100644 (file)
@@ -54,13 +54,8 @@ meta_back_bind( Operation *op, SlapReply *rs )
 
        rs->sr_err = LDAP_SUCCESS;
 
-#ifdef NEW_LOGGING
-       LDAP_LOG( BACK_META, ENTRY, "meta_back_bind: dn: %s.\n",
-                       op->o_req_dn.bv_val, 0, 0 );
-#else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_ARGS, "meta_back_bind: dn: %s.\n%s%s",
                        op->o_req_dn.bv_val, "", "" );
-#endif /* !NEW_LOGGING */
 
        if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) {
                isroot = 1;
@@ -70,15 +65,9 @@ meta_back_bind( Operation *op, SlapReply *rs )
        lc = meta_back_getconn( op, rs, op_type,
                        &op->o_req_ndn, NULL );
        if ( !lc ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( BACK_META, NOTICE,
-                               "meta_back_bind: no target for dn %s.\n",
-                               op->o_req_dn.bv_val, 0, 0 );
-#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ANY,
                                "meta_back_bind: no target for dn %s.\n%s%s",
                                op->o_req_dn.bv_val, "", "");
-#endif /* !NEW_LOGGING */
 
                send_ldap_result( op, rs );
                return -1;
@@ -111,18 +100,11 @@ meta_back_bind( Operation *op, SlapReply *rs )
                         * A bind operation is expected to have
                         * ONE CANDIDATE ONLY!
                         */
-#ifdef NEW_LOGGING
-                       LDAP_LOG( BACK_META, WARNING,
-                                       "==>meta_back_bind: more than one"
-                                       " candidate is attempting to bind"
-                                       " ...\n" , 0, 0, 0 );
-#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
                                        "==>meta_back_bind: more than one"
                                        " candidate is attempting to bind"
                                        " ...\n%s%s%s", 
                                        "", "", "" );
-#endif /* !NEW_LOGGING */
                }
 
                if ( isroot && li->targets[ i ]->pseudorootdn.bv_val != NULL ) {
@@ -169,7 +151,7 @@ meta_back_bind( Operation *op, SlapReply *rs )
                        rs->sr_err = LDAP_INVALID_CREDENTIALS;
                }
 
-               rs->sr_err = ldap_back_map_result( rs );
+               rs->sr_err = slap_map_api2result( rs );
                send_ldap_result( op, rs );
                return -1;
        }
@@ -191,7 +173,7 @@ meta_back_do_single_bind(
 )
 {
        struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct berval   mdn = { 0, NULL };
+       struct berval   mdn = BER_BVNULL;
        ber_int_t       msgid;
        dncookie        dc;
        struct metasingleconn   *lsc = &lc->conns[ candidate ];
@@ -203,7 +185,7 @@ meta_back_do_single_bind(
        dc.rwmap = &li->targets[ candidate ]->rwmap;
        dc.conn = op->o_conn;
        dc.rs = rs;
-       dc.ctx = "bindDn";
+       dc.ctx = "bindDN";
 
        if ( ldap_back_dn_massage( &dc, &op->o_req_dn, &mdn ) ) {
                send_ldap_result( op, rs );
@@ -214,7 +196,7 @@ meta_back_do_single_bind(
                rs->sr_err = ldap_set_option( lsc->ld, 
                                LDAP_OPT_SERVER_CONTROLS, op->o_ctrls );
                if ( rs->sr_err != LDAP_SUCCESS ) {
-                       rs->sr_err = ldap_back_map_result( rs );
+                       rs->sr_err = slap_map_api2result( rs );
                        goto return_results;
                }
        }
@@ -226,7 +208,7 @@ meta_back_do_single_bind(
                        LDAP_SASL_SIMPLE, &op->oq_bind.rb_cred,
                        op->o_ctrls, NULL, NULL);
        if ( rs->sr_err != LDAP_SUCCESS ) {
-               rs->sr_err = ldap_back_map_result( rs );
+               rs->sr_err = slap_map_api2result( rs );
                goto return_results;
        }
 
@@ -333,19 +315,11 @@ meta_back_dobind( struct metaconn *lc, Operation *op )
                                op->o_ctrls, NULL, NULL);
                if ( rc != LDAP_SUCCESS ) {
                        
-#ifdef NEW_LOGGING
-                       LDAP_LOG( BACK_META, WARNING,
-                                       "meta_back_dobind: (anonymous)"
-                                       " bind failed"
-                                       " with error %d (%s)\n",
-                                       rc, ldap_err2string( rc ), 0 );
-#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
                                        "==>meta_back_dobind: (anonymous)"
                                        " bind failed"
                                        " with error %d (%s)\n",
                                        rc, ldap_err2string( rc ), 0 );
-#endif /* !NEW_LOGGING */
 
                        /*
                         * null cred bind should always succeed
@@ -436,23 +410,14 @@ meta_back_op_result( struct metaconn *lc, Operation *op, SlapReply *rs )
                                        LDAP_OPT_ERROR_STRING, &msg );
                        ldap_get_option( lsc->ld,
                                        LDAP_OPT_MATCHED_DN, &match );
-                       rs->sr_err = ldap_back_map_result( rs );
+                       rs->sr_err = slap_map_api2result( rs );
 
-#ifdef NEW_LOGGING
-                       LDAP_LOG( BACK_META, RESULTS,
-                                       "meta_back_op_result: target"
-                                       " <%d> sending msg \"%s\""
-                                       " (matched \"%s\")\n",
-                                       i, ( msg ? msg : "" ),
-                                       ( match ? match : "" ) );
-#else /* !NEW_LOGGING */
                        Debug(LDAP_DEBUG_ANY,
                                        "==> meta_back_op_result: target"
                                        " <%d> sending msg \"%s\""
                                        " (matched \"%s\")\n", 
                                        i, ( msg ? msg : "" ),
                                        ( match ? match : "" ) );
-#endif /* !NEW_LOGGING */
 
                        /*
                         * FIXME: need to rewrite "match" (need rwinfo)