*** rlm_ldap.c~ 2005-12-30 06:52:53.000000000 +0900 --- rlm_ldap.c 2006-03-22 15:56:34.000000000 +0900 *************** *** 1649,1654 **** --- 1649,1655 ---- char basedn[MAX_FILTER_STR_LEN]; int res; VALUE_PAIR *vp_user_dn; + VALUE_PAIR *config_user_dn; VALUE_PAIR *module_fmsg_vp; char module_fmsg[MAX_STRING_LEN]; LDAP_CONN *conn; *************** *** 1702,1707 **** --- 1703,1714 ---- request->username->strvalue, request->password->strvalue); while((vp_user_dn = pairfind(request->packet->vps, PW_LDAP_USERDN)) == NULL) { + + if ((config_user_dn = pairfind(request->config_items, PW_LDAP_USERDN)) != NULL) { + config_user_dn = pairmake("Ldap-UserDn", config_user_dn->strvalue, T_OP_EQ); + pairxlatmove(request, &request->packet->vps, &config_user_dn); + continue; + } if (!radius_xlat(filter, sizeof(filter), inst->filter, request, NULL)) { radlog (L_ERR, "rlm_ldap: unable to create filter.\n");