From 39ec789a0ba4337d86507af2f6ada8497ef3be96 Mon Sep 17 00:00:00 2001 From: thebaptiste Date: Fri, 9 Feb 2024 16:17:59 +0000 Subject: [PATCH] fix: pass missing options -c, -o and -g from wrapper to logger process --- src/log_proxy_wrapper.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/log_proxy_wrapper.c b/src/log_proxy_wrapper.c index a43ad24..bd68067 100644 --- a/src/log_proxy_wrapper.c +++ b/src/log_proxy_wrapper.c @@ -61,7 +61,7 @@ void spawn_logproxy_async(const gchar *fifo_path, const gchar *log_path) { gchar *rotation_size_str = g_strdup_printf("%li", rotation_size); gchar *rotation_time_str = g_strdup_printf("%li", rotation_time); gchar *rotated_files_str = g_strdup_printf("%i", rotated_files); - gchar *argv[20] = { + gchar *argv[25] = { "log_proxy", "-s", rotation_size_str, "-t", rotation_time_str, @@ -79,6 +79,18 @@ void spawn_logproxy_async(const gchar *fifo_path, const gchar *log_path) { argv[argc++] = "-T"; argv[argc++] = timestamp_prefix; } + if (chmod_str != NULL) { + argv[argc++] = "-c"; + argv[argc++] = chmod_str; + } + if (chown_str != NULL) { + argv[argc++] = "-o"; + argv[argc++] = chown_str; + } + if (chgrp_str != NULL) { + argv[argc++] = "-g"; + argv[argc++] = chgrp_str; + } argv[argc++] = (gchar*) log_path; argv[argc] = NULL;