From b9e991e322fd96900bb11d30d21cfd83c4358011 Mon Sep 17 00:00:00 2001 From: Quentin Armitage Date: Sun, 28 Apr 2024 22:27:09 +0100 Subject: [PATCH] core: initialise script structure in start_validate_reload_conf_child() Due to the path field not being set to NULL, it was attempting to exec a random string when reload_check_config was configured. Signed-off-by: Quentin Armitage --- keepalived/core/main.c | 2 +- lib/notify.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keepalived/core/main.c b/keepalived/core/main.c index 4628e5e2b..0316e8450 100644 --- a/keepalived/core/main.c +++ b/keepalived/core/main.c @@ -994,7 +994,7 @@ reload_check_child_thread(thread_ref_t thread) static void start_validate_reload_conf_child(void) { - notify_script_t script; + notify_script_t script = { .path = NULL }; int i; int ret; int argc; diff --git a/lib/notify.c b/lib/notify.c index b6f9df1dc..119c826c5 100644 --- a/lib/notify.c +++ b/lib/notify.c @@ -214,7 +214,7 @@ system_call_script(thread_master_t *m, thread_func_t func, void * arg, unsigned execve(script->path ? script->path : script->args[0], args.execve_args, environ); /* error */ - log_message(LOG_ALERT, "Error exec-ing command '%s', error %d: %m", script->args[0], errno); + log_message(LOG_ALERT, "Error exec-ing command '%s', error %d: %m", script->path ? script->path : script->args[0], errno); } else { retval = system(str = cmd_str(script));