>а еще лучше - так выложить гденить..
>
>думаю тема многим интересна
За правильность использованных методов не отвечаю, но в моих условиях работает:
diff -rc /usr/ports/net/freeradius/work/freeradius-1.0.2/src/modules/rlm_sql/rlm_sql.c /usr/local/src/freeradius/freeradius-1.0.2/src/modules/rlm_sql/rlm_sql.c
*** /usr/ports/net/freeradius/work/freeradius-1.0.2/src/modules/rlm_sql/rlm_sql.c Thu Sep 30 18:54:22 2004
--- /usr/local/src/freeradius/freeradius-1.0.2/src/modules/rlm_sql/rlm_sql.c Mon Feb 28 17:05:45 2005
***************
*** 883,889 ****
--- 883,892 ----
SQLSOCK *sqlsocket = NULL;
VALUE_PAIR *pair;
+ VALUE_PAIR *check_tmp = NULL;
+ VALUE_PAIR *reply_tmp = NULL;
SQL_INST *inst = instance;
+ int found = 0;
int ret = RLM_MODULE_OK;
int numaffected = 0;
int acctstatustype = 0;
***************
*** 958,963 ****
--- 961,973 ----
ret = RLM_MODULE_FAIL;
}
else {
+ found = sql_getvpdata(inst, sqlsocket, &check_tmp, querystr, PW_VP_USERDATA);
+ if (found > 0) {
+ radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_check_query, request, sql_escape_func);
+ sql_getvpdata(inst, sqlsocket, &check_tmp, querystr, PW_VP_GROUPDATA);
+ radius_xlat(querystr, sizeof(querystr), inst->config->authorize_reply_query, request, sql_escape_func);
+ sql_getvpdata(inst, sqlsocket, &reply_tmp, querystr, PW_VP_USERDATA);
+ }
numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config);
if (numaffected < 1) {
***************
*** 1106,1111 ****
--- 1116,1125 ----
}
+ pairxlatmove(request, &request->reply->vps, &reply_tmp);
+ pairxlatmove(request, &request->config_items, &check_tmp);
+ pairfree(&reply_tmp);
+ pairfree(&check_tmp);
sql_release_socket(inst, sqlsocket);
return ret;