]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/bind.c
ITS#2607: improve socket() error logging with AF info
[openldap] / servers / slapd / bind.c
index 112f099e05262f594414651df115d025515448ef..2678c18b4883fc22779ace536c51107881d57a68 100644 (file)
@@ -43,7 +43,7 @@ do_bind(
        struct berval mech = { 0, NULL };
        struct berval dn = { 0, NULL };
        ber_tag_t tag;
-       Backend *be;
+       Backend *be = NULL;
 
 #ifdef LDAP_SLAPI
        Slapi_PBlock *pb = op->o_pb;
@@ -64,7 +64,7 @@ do_bind(
        /* log authorization identity demotion */
        if ( op->o_conn->c_dn.bv_len ) {
                Statslog( LDAP_DEBUG_STATS,
-                       "conn=%lu op=%lu BIND anonymous mech=implicit ssf=0",
+                       "conn=%lu op=%lu BIND anonymous mech=implicit ssf=0\n",
                        op->o_connid, op->o_opid, 0, 0, 0 );
        }
 
@@ -540,9 +540,10 @@ do_bind(
                 */
                int ldapRc;
 
-               if ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&ldapRc ) != 0 )
+               if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&ldapRc ) != 0 ) ||
+                    ldapRc == LDAP_SUCCESS ) {
                        ldapRc = LDAP_OTHER;
-
+               }
                op->orb_edn.bv_val = NULL;
                op->orb_edn.bv_len = 0;
                if ( rs->sr_err != SLAPI_BIND_FAIL && ldapRc == LDAP_SUCCESS ) {