Memory big problem
And to you thanks. Can i offer small patch for realization of comparison (!~) in rlm_checkval? --- rlm_checkval.c 2005-12-14 03:38:08.000000000 +1000 +++ rlm_checkval.c.patched 2005-12-14 10:15:59.000000000 +1000 @@ -208,6 +208,7 @@ VALUE_PAIR *chk_vp, *item_vp; VALUE_PAIR *tmp; char found = 0; + int opflag = T_OP_REG_EQ; /* quiet the compiler */ instance = instance; @@ -244,6 +245,9 @@ * Check if item != check */ found = 1; + + opflag = chk_vp->operator; + if (data->dat_type == PW_TYPE_STRING || data->dat_type == PW_TYPE_OCTETS) { if (item_vp->length != chk_vp->length) @@ -266,12 +270,18 @@ } #ifdef HAVE_REGEX_H if (ret == RLM_MODULE_REJECT && - chk_vp->operator == T_OP_REG_EQ) { + (chk_vp->operator == T_OP_REG_EQ || + chk_vp->operator == T_OP_REG_NE)) { regex_t reg; int err; char err_msg[MAX_STRING_LEN]; - DEBUG("rlm_checkval: Doing regex"); + if (opflag == T_OP_REG_EQ) { + DEBUG("rlm_checkval: Doing regex (=~)"); + } else { + DEBUG("rlm_checkval: Doing regex (!~)"); + } + err = regcomp(®, (char *)chk_vp->vp_strvalue, REG_EXTENDED|REG_NOSUB); if (err){ regerror(err, ®,err_msg, MAX_STRING_LEN); @@ -289,6 +299,14 @@ } while (ret == RLM_MODULE_REJECT && tmp != NULL); + if (opflag == T_OP_REG_NE) { + if (ret == RLM_MODULE_OK) + ret = RLM_MODULE_REJECT; + else + if (ret == RLM_MODULE_REJECT) + ret = RLM_MODULE_OK; + } + if (ret == RLM_MODULE_REJECT) { if (!item_vp && data->notfound_reject){ char module_fmsg[MAX_STRING_LEN];
participants (1)
-
Dmitry V. Pleganoff