mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 08:39:37 -05:00
Previous commit included undesired changes.
This commit is contained in:
parent
9b958147f8
commit
a73ffbe3cd
1 changed files with 15 additions and 22 deletions
|
|
@ -387,31 +387,24 @@ slap_sasl_canonicalize(
|
|||
in ? in : "<empty>" );
|
||||
#endif
|
||||
|
||||
if (flags == SASL_CU_AUTHID) {
|
||||
rc = slap_sasl_getdn( conn, (char *)in, (char *)user_realm,
|
||||
&dn, FLAG_GETDN_AUTHCID);
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
sasl_seterror( sconn, 0, ldap_err2string( rc ) );
|
||||
return SASL_NOAUTHZ;
|
||||
}
|
||||
rc = slap_sasl_getdn( conn, (char *)in, (char *)user_realm, &dn,
|
||||
(flags == SASL_CU_AUTHID) ? FLAG_GETDN_AUTHCID : FLAG_GETDN_AUTHZID );
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
sasl_seterror( sconn, 0, ldap_err2string( rc ) );
|
||||
return SASL_NOAUTHZ;
|
||||
}
|
||||
|
||||
if ( out_max < dn.bv_len ) {
|
||||
return SASL_BUFOVER;
|
||||
}
|
||||
|
||||
AC_MEMCPY( out, dn.bv_val, dn.bv_len );
|
||||
out[dn.bv_len] = '\0';
|
||||
|
||||
*out_len = dn.bv_len;
|
||||
|
||||
ch_free( dn.bv_val );
|
||||
|
||||
} else {
|
||||
strcpy( out, in );
|
||||
|
||||
*out_len = strlen( in );
|
||||
if ( out_max < dn.bv_len ) {
|
||||
return SASL_BUFOVER;
|
||||
}
|
||||
|
||||
AC_MEMCPY( out, dn.bv_val, dn.bv_len );
|
||||
out[dn.bv_len] = '\0';
|
||||
|
||||
*out_len = dn.bv_len;
|
||||
|
||||
ch_free( dn.bv_val );
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
|
||||
"slap_sasl_canonicalize: conn %d %s=\"%s\"\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue