module-dev proglem

westwood yczxwestwood at gmail.com
Mon Oct 4 04:21:51 CEST 2010


I am developping a module for freeradius. but i don't know how to get VPs
from radcheck or radgroupcheck
Later i maybe found one in rlm_checkval.c :
checkval_instantiate (...){
              ............
    memset(&flags, 0, sizeof(flags));
    dict_addattr(data->check_name, 0, PW_TYPE_STRING, -1,flags);
    dattr = dict_attrbyname(data->check_name);
    if (!dattr){
        radlog(L_ERR, "rlm_checkval: No such attribute %s",
               data->check_name);
        checkval_detach(data);
        return -1;
    }
    data->chk_attr = dattr->attr;
    DEBUG2("rlm_checkval: Registered name %s for attribute %d",
        dattr->name,dattr->attr);
}


do_checkval(...)
{
tmp = request->config_items;
    do{
        if (!(chk_vp = pairfind(tmp, data->chk_attr))){
            if (!found){
                DEBUG2("rlm_checkval: Could not find attribute named %s in
check pairs",data->check_name);
                ret = RLM_MODULE_NOTFOUND;
            }
            break;
        }
}

This still doesn't work when i put my-defined Attribute in radcheck for one
user : No XXX defined
Is there any other API for this?
Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20101004/f052686a/attachment.html>


More information about the Freeradius-Devel mailing list