+ return RLM_MODULE_OK;
+}
+
+/*
+ * First, look for Exec-Program && Exec-Program-Wait.
+ *
+ * Then, call exec_dispatch.
+ */
+static int exec_accounting(void *instance, REQUEST *request)
+{
+ int result;
+ int exec_wait = 0;
+ VALUE_PAIR *vp;
+ rlm_exec_t *inst = (rlm_exec_t *) instance;
+
+ /*
+ * The "bare" exec module takes care of handling
+ * Exec-Program and Exec-Program-Wait.
+ */
+ if (!inst->bare) return exec_dispatch(instance, request);
+
+ vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM);
+ if (vp) {
+ exec_wait = 0;
+
+ } else if ((vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM_WAIT)) != NULL) {
+ exec_wait = 1;
+ }
+ if (!vp) return RLM_MODULE_NOOP;
+
+ result = radius_exec_program(vp->vp_strvalue, request, exec_wait,
+ NULL, 0, request->packet->vps, NULL,
+ inst->shell_escape);
+ if (result != 0) {
+ return RLM_MODULE_REJECT;
+ }