mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Fix check for "anonymous" in sasl_getdn
This commit is contained in:
parent
ed8f299245
commit
cef9fcf78b
@ -161,15 +161,19 @@ int slap_sasl_getdn( Connection *conn, char *id, int len,
|
|||||||
dn->bv_val = NULL;
|
dn->bv_val = NULL;
|
||||||
dn->bv_len = 0;
|
dn->bv_len = 0;
|
||||||
|
|
||||||
/* Blatantly anonymous ID */
|
if ( id ) {
|
||||||
if( id &&
|
if ( len == 0 ) len = strlen( id );
|
||||||
( id[sizeof( "anonymous" )-1] == '\0'
|
|
||||||
|| id[sizeof( "anonymous" )-1] == '@' ) &&
|
/* Blatantly anonymous ID */
|
||||||
!strncasecmp( id, "anonymous", sizeof( "anonymous" )-1) ) {
|
if ( len == sizeof("anonymous") - 1 &&
|
||||||
return( LDAP_SUCCESS );
|
!strcasecmp( id, "anonymous" ) ) {
|
||||||
|
return( LDAP_SUCCESS );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = conn->c_sasl_context;
|
ctx = conn->c_sasl_context;
|
||||||
if ( len == 0 ) len = strlen( id );
|
|
||||||
|
|
||||||
/* An authcID needs to be converted to authzID form */
|
/* An authcID needs to be converted to authzID form */
|
||||||
if( flags & FLAG_GETDN_AUTHCID ) {
|
if( flags & FLAG_GETDN_AUTHCID ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user