mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 07:39:35 -05:00
ITS#4954 clear c_sasl_dn after error
This commit is contained in:
parent
2779af4730
commit
e86e4f98af
1 changed files with 6 additions and 2 deletions
|
|
@ -610,6 +610,7 @@ slap_sasl_canonicalize(
|
||||||
*/
|
*/
|
||||||
if ( flags == SASL_CU_AUTHID && !auxvals[SLAP_SASL_PROP_AUTHZ].values ) {
|
if ( flags == SASL_CU_AUTHID && !auxvals[SLAP_SASL_PROP_AUTHZ].values ) {
|
||||||
conn->c_sasl_dn.bv_val = (char *) in;
|
conn->c_sasl_dn.bv_val = (char *) in;
|
||||||
|
conn->c_sasl_dn.bv_len = 0;
|
||||||
} else if ( flags == SASL_CU_AUTHZID && conn->c_sasl_dn.bv_val ) {
|
} else if ( flags == SASL_CU_AUTHZID && conn->c_sasl_dn.bv_val ) {
|
||||||
rc = strcmp( in, conn->c_sasl_dn.bv_val );
|
rc = strcmp( in, conn->c_sasl_dn.bv_val );
|
||||||
conn->c_sasl_dn.bv_val = NULL;
|
conn->c_sasl_dn.bv_val = NULL;
|
||||||
|
|
@ -624,13 +625,13 @@ slap_sasl_canonicalize(
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
sasl_seterror( sconn, 0, ldap_err2string( rc ) );
|
sasl_seterror( sconn, 0, ldap_err2string( rc ) );
|
||||||
return SASL_NOAUTHZ;
|
return SASL_NOAUTHZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
names[0] = slap_propnames[which];
|
names[0] = slap_propnames[which];
|
||||||
names[1] = NULL;
|
names[1] = NULL;
|
||||||
|
|
||||||
prop_set( props, names[0], (char *)&dn, sizeof( dn ) );
|
prop_set( props, names[0], (char *)&dn, sizeof( dn ) );
|
||||||
|
|
||||||
Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n",
|
Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n",
|
||||||
conn ? conn->c_connid : -1, names[0]+1,
|
conn ? conn->c_connid : -1, names[0]+1,
|
||||||
dn.bv_val ? dn.bv_val : "<EMPTY>" );
|
dn.bv_val ? dn.bv_val : "<EMPTY>" );
|
||||||
|
|
@ -1710,6 +1711,9 @@ int slap_sasl_bind( Operation *op, SlapReply *rs )
|
||||||
send_ldap_sasl( op, rs );
|
send_ldap_sasl( op, rs );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if ( op->o_conn->c_sasl_dn.bv_len )
|
||||||
|
ch_free( op->o_conn->c_sasl_dn.bv_val );
|
||||||
|
BER_BVZERO( &op->o_conn->c_sasl_dn );
|
||||||
#if SASL_VERSION_MAJOR >= 2
|
#if SASL_VERSION_MAJOR >= 2
|
||||||
rs->sr_text = sasl_errdetail( ctx );
|
rs->sr_text = sasl_errdetail( ctx );
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue