/* exec.c */
int radius_exec_program(const char *, REQUEST *,
int, char *user_msg,
- int msg_len, int parse_vp);
+ int msg_len, VALUE_PAIR **pairs);
/* timestr.c */
int timestr_match(char *, time_t);
*/
rcode = radius_exec_program(exec_program, request,
exec_wait,
- NULL, 0, TRUE);
+ NULL, 0, &vp);
+ free(exec_program);
+
+ /*
+ * Always add the value-pairs to the reply.
+ *
+ * If we're not waiting, then the pairs
+ * will be empty, so this won't matter.
+ */
+ pairmove(&request->reply->vps, &vp);
+ pairfree(&vp);
+
if (exec_wait) {
if (rcode != 0) {
- free(exec_program);
return reply;
}
}
}
- if (exec_program)
- free(exec_program);
-
/*
* Maybe one of the preacct modules has decided
* that a proxy should be used. If so, get out of
* do it first before sending the reply.
*/
if (exec_program && exec_wait) {
- if (radius_exec_program(exec_program, request,
+ r = radius_exec_program(exec_program, request,
exec_wait,
- umsg, sizeof(umsg), TRUE) != 0) {
- free(exec_program);
+ umsg, sizeof(umsg), &tmp);
+ free(exec_program);
+ exec_program = NULL;
+
+ /*
+ * Always add the value-pairs to the reply.
+ */
+ pairmove(&request->reply->vps, &tmp);
+ pairfree(&tmp);
+ if (r < 0) {
/*
* Error. radius_exec_program() returns -1 on
* fork/exec errors, or >0 if the exec'ed program
* No need to check the exit status here.
*/
radius_exec_program(exec_program, request, exec_wait,
- NULL, 0, FALSE);
+ NULL, 0, NULL);
}
if (exec_program)
DEBUG2("rlm_exec: %d %s", inst->wait, buffer);
result = radius_exec_program(buffer, request, inst->wait,
- out, outlen, FALSE);
+ out, outlen, NULL);
DEBUG2("rlm_exec: result %d", result);
if (result != 0) {
out[0] = '\0';