X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbind.c;h=2678c18b4883fc22779ace536c51107881d57a68;hb=6e602b549420181bfe6ad55d863963a5b11544d1;hp=b4c1cf72b104353f6856833eaac9734b68ee09e6;hpb=280fc819cf9e8b05efa4df875291af0f20666d40;p=openldap diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index b4c1cf72b1..2678c18b48 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -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 ); } @@ -528,7 +528,7 @@ do_bind( slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) ); rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb ); - if ( rs->sr_err != SLAPI_BIND_SUCCESS ) { + if ( rs->sr_err < 0 ) { /* * Binding is a special case for SLAPI plugins. It is * possible for a bind plugin to be successful *and* @@ -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 ) { @@ -641,7 +642,7 @@ do_bind( } #if defined( LDAP_SLAPI ) - if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) != 0 ) { + if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, INFO, "do_bind: Bind postoperation plugins failed\n", 0, 0, 0);