From: Alan T. DeKok Date: Fri, 8 Dec 2023 12:57:06 +0000 (-0500) Subject: clean up error handling in exec oneshot X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98b6d20ab40e736b55b3c7cfbafe2bb2e2fc88f3;p=thirdparty%2Ffreeradius-server.git clean up error handling in exec oneshot so that the it saves an fr_strerror(), and all callers use RPEDEBUG() to describe the error. This gives a consistent behavior --- diff --git a/src/lib/server/exec.c b/src/lib/server/exec.c index 0ba1810b2f3..8c11bae2161 100644 --- a/src/lib/server/exec.c +++ b/src/lib/server/exec.c @@ -843,9 +843,9 @@ static void exec_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void request_t *request = exec->request; if (exec->stdout_fd < 0) { - REDEBUG("Timeout waiting for program to exit - killing it and failing the request"); + fr_strerror_const("Timeout waiting for program to exit - killing it and failing the request"); } else { - REDEBUG("Timeout running program - killing it and failing the request"); + fr_strerror_const("Timeout running program - killing it and failing the request"); } exec->failed = true; diff --git a/src/lib/unlang/tmpl.c b/src/lib/unlang/tmpl.c index e2b9c682aa6..6877a98becb 100644 --- a/src/lib/unlang/tmpl.c +++ b/src/lib/unlang/tmpl.c @@ -179,6 +179,7 @@ static unlang_action_t unlang_tmpl_exec_wait_resume(rlm_rcode_t *p_result, reque false, (state->out != NULL), state, state->args.exec.timeout) < 0) { + RPEDEBUG("Failed executing program"); *p_result = RLM_MODULE_FAIL; return UNLANG_ACTION_CALCULATE_RESULT; }