]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: Add program_client_parameters.append_args
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Aug 2024 10:49:13 +0000 (13:49 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:59 +0000 (10:39 +0200)
src/lib-program-client/program-client.c
src/lib-program-client/program-client.h

index fbc75c28aa222f3de7457b23daed0c102423ba20..5c2bfd43082b8890a71aad09baef9449bcdd4718 100644 (file)
@@ -801,6 +801,15 @@ program_client_create_filter_auto(struct event *event, const char *execute_name,
        }
 
        const char *const *args = t_strsplit_spaces(set->execute_args, " ");
+       if (params->append_args != NULL) {
+               ARRAY_TYPE(const_string) new_args;
+               t_array_init(&new_args, 8);
+               array_append(&new_args, args, str_array_length(args));
+               array_append(&new_args, params->append_args,
+                            str_array_length(params->append_args));
+               array_append_zero(&new_args);
+               args = array_front(&new_args);
+       }
        if (strcmp(set->execute_driver, "unix") == 0) {
                *pc_r = program_client_unix_create(event,
                                set->execute_unix_socket_path, args, params);
index f38fb54785c7c5bffd4b3257f2beed3d63cc0552..c460da9bb06ac0eaaa171c8c184189bb7c0043a6 100644 (file)
@@ -16,6 +16,8 @@ struct program_client_parameters {
        unsigned int client_connect_timeout_msecs;
        unsigned int input_idle_timeout_msecs;
        const char *dns_client_socket_path;
+       /* Append extra args to execute_args */
+       const char *const *append_args;
 
        /* use o_stream_dot, which is mainly useful to make sure that an
           unexpectedly closed connection doesn't cause the partial input to