- /* FIXME: how can we get the realm? */
- {
- int rc;
- char buf[ SLAP_LDAPDN_MAXLEN ];
- struct berval id = { ctrl->ldctl_value.bv_len, (char *)buf },
- user = { 0, NULL },
- realm = { 0, NULL },
- mech = { 0, NULL };
-
- strncpy( buf, ctrl->ldctl_value.bv_val, sizeof( buf ) );
-
- rc = slap_parse_user( &id, &user, &realm, &mech );
- if ( rc == LDAP_SUCCESS ) {
- struct berval authz = BER_BVC( "AUTHZ" );
-
- if ( mech.bv_len && !bvmatch( &mech, &authz) ) {
- rs->sr_text = "mech not allowed in authzId";
- return LDAP_PROXY_AUTHZ_FAILURE;
- }
- } else {
- user = ctrl->ldctl_value;
- }
+ rc = slap_sasl_getdn( op->o_conn, op,
+ ctrl->ldctl_value.bv_val, ctrl->ldctl_value.bv_len,
+ NULL, &dn, SLAP_GETDN_AUTHZID );