From 3786f3d170049f07c919c3996c7860b35a2b4c4e Mon Sep 17 00:00:00 2001 From: aland Date: Thu, 13 Apr 2006 16:28:30 +0000 Subject: [PATCH] Backwards compatibility ported from the head --- src/modules/rlm_mschap/rlm_mschap.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index 19aabb5..527b62f 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -289,6 +289,7 @@ typedef struct rlm_mschap_t { char *passwd_file; char *xlat_name; char *ntlm_auth; + char *auth_type; } rlm_mschap_t; @@ -665,6 +666,13 @@ static int mschap_instantiate(CONF_SECTION *conf, void **instance) xlat_register(xlat_name, mschap_xlat, inst); } + /* + * For backwards compatibility + */ + if (!dict_valbyname(PW_AUTH_TYPE, inst->xlat_name)) { + inst->auth_type = "MS-CHAP"; + } + return 0; } @@ -979,8 +987,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 */ -- 2.1.4