]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clean up error handling in exec oneshot
authorAlan T. DeKok <aland@freeradius.org>
Fri, 8 Dec 2023 12:57:06 +0000 (07:57 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 8 Dec 2023 12:58:42 +0000 (07:58 -0500)
so that the it saves an fr_strerror(), and all callers use
RPEDEBUG() to describe the error.  This gives a consistent
behavior

src/lib/server/exec.c
src/lib/unlang/tmpl.c

index 0ba1810b2f3186175d47e37d80aca9143c305396..8c11bae21619f07643b7008a4c32488647594a7b 100644 (file)
@@ -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;
 
index e2b9c682aa6d27f1a9bdca387e5119484332b4fe..6877a98becbda702dd5f3cd83b6980cf42b91548 100644 (file)
@@ -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;
        }