> Michael Chernyakhovsky <[EMAIL PROTECTED]> wrote:
>> How I can to execute some external program on Accounting-Request?
>>
>> adding lines like
> ...
>> to raddb/acct_users does not work.
>>
>> There is no radius_exec_program() call after PW_ACCOUNTING_REQUEST
>> received in sources. Only after PW_AUTHENTICATION_REQUEST.
> That's definitely a bug. Just a second, and I'll go poke at the
> code.
It's all right in follow code from src/main/acct.c. BUT!
where is second calling of radius_exec_program() for PW_EXEC_PROGRAM
(Exec-Program)?
in this case we have exec_wait = 0.
so (exec_program && exec_wait) is FALSE!
if ((vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM)) != NULL) {
exec_wait = 0;
exec_program = strdup((char *)vp->strvalue);
pairdelete(&request->reply->vps, PW_EXEC_PROGRAM);
}
if ((vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM_WAIT)) != NULL) {
exec_wait = 1;
exec_program = strdup((char *)vp->strvalue);
pairdelete(&request->reply->vps, PW_EXEC_PROGRAM_WAIT);
}
/*
* If we want to exec a program, but wait for it,
* do it first before sending the reply.
*/
if (exec_program && exec_wait) {
if (radius_exec_program(exec_program, request,
exec_wait, NULL) != 0) {
return reply;
}
}
--
Michael Chernyakhovsky,
NP Maginfocenter,
Magnitogorsk, RF
e-mail: [EMAIL PROTECTED]
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html