From: aland Date: Thu, 13 Apr 2006 16:28:09 +0000 (+0000) Subject: Added code for backwards compatibility X-Git-Tag: release_2_0_0_pre1~629 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=c167cc485d552f000d078cb86f117e0255ed9b1f;p=freeradius.git Added code for backwards compatibility --- diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index 126b112..6386b95 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -256,6 +256,7 @@ typedef struct rlm_mschap_t { char *passwd_file; char *xlat_name; char *ntlm_auth; + char *auth_type; } rlm_mschap_t; @@ -668,6 +669,13 @@ static int mschap_instantiate(CONF_SECTION *conf, void **instance) if (xlat_name) inst->xlat_name = strdup(xlat_name); + /* + * For backwards compatibility + */ + if (!dict_valbyname(PW_AUTH_TYPE, inst->xlat_name)) { + inst->auth_type = "MS-CHAP"; + } + return 0; } @@ -981,8 +989,8 @@ static int mschap_authorize(void * instance, REQUEST *request) * will take care of turning clear-text passwords into * NT/LM passwords. */ - vp = pairmake("Auth-Type", inst->xlat_name, T_OP_EQ); - rad_assert(vp != NULL); + vp = pairmake("Auth-Type", inst->auth_type, T_OP_EQ); + if (!vp) return RLM_MODULE_FAIL; pairmove(&request->config_items, &vp); pairfree(&vp); /* may be NULL */