From 21ae1be7b1189d8d618e26ebf7c49379b446b719 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Fri, 18 Jul 2025 10:20:26 -0600 Subject: [PATCH] Simplify trigger handling. Remove trigger xlat, we just use the request like. Use tmpl_afrom_substr instead of custom parsing logic. --- src/bin/radiusd.c | 6 +- src/lib/server/base.c | 2 +- src/lib/server/connection.c | 2 +- src/lib/server/exfile.c | 12 +- src/lib/server/main_loop.c | 2 +- src/lib/server/pool.c | 22 +-- src/lib/server/trigger.c | 168 +++++--------------- src/lib/server/trigger.h | 10 +- src/lib/server/trunk.c | 4 +- src/lib/unlang/xlat_builtin.c | 1 - src/lib/unlang/xlat_tokenize.c | 2 +- src/listen/ldap_sync/active_directory.c | 2 +- src/listen/ldap_sync/persistent_search.c | 2 +- src/listen/ldap_sync/proto_ldap_sync_ldap.c | 2 +- src/listen/ldap_sync/rfc4533.c | 2 +- src/modules/rlm_test/rlm_test.c | 2 +- 16 files changed, 73 insertions(+), 168 deletions(-) diff --git a/src/bin/radiusd.c b/src/bin/radiusd.c index 46e8f65863..5846d5e5e6 100644 --- a/src/bin/radiusd.c +++ b/src/bin/radiusd.c @@ -939,7 +939,7 @@ int main(int argc, char *argv[]) } } - trigger_exec(NULL, NULL, "server.start", false, NULL); + trigger(NULL, NULL, "server.start", false, NULL); /* * Inform the parent (who should still be waiting) that the rest of @@ -1024,8 +1024,8 @@ int main(int argc, char *argv[]) * Fire signal and stop triggers after ignoring SIGTERM, so handlers are * not killed with the rest of the process group, below. */ - if (status == 2) trigger_exec(NULL, NULL, "server.signal.term", true, NULL); - trigger_exec(NULL, NULL, "server.stop", false, NULL); + if (status == 2) trigger(NULL, NULL, "server.signal.term", true, NULL); + trigger(NULL, NULL, "server.stop", false, NULL); /* * Stop the scheduler, this signals the network and worker threads diff --git a/src/lib/server/base.c b/src/lib/server/base.c index fc45011a11..7c5a7880cd 100644 --- a/src/lib/server/base.c +++ b/src/lib/server/base.c @@ -102,7 +102,7 @@ int server_init(CONF_SECTION *cs, char const *dict_dir, fr_dict_t *dict) * any xlat functions/dictionary attributes have been registered and * before the modules actually want to use triggers or open connections. */ - if (trigger_exec_init(cs) < 0) return -1; + if (trigger_init(cs) < 0) return -1; /* * And then load the virtual servers. diff --git a/src/lib/server/connection.c b/src/lib/server/connection.c index b9572d4292..045041cd0f 100644 --- a/src/lib/server/connection.c +++ b/src/lib/server/connection.c @@ -125,7 +125,7 @@ struct connection_s { #define CONN_TRIGGER(_state) do { \ if (conn->pub.triggers) { \ - trigger_exec(unlang_interpret_get_thread_default(), \ + trigger(unlang_interpret_get_thread_default(), \ NULL, fr_table_str_by_value(connection_trigger_names, _state, ""), true, NULL); \ } \ } while (0) diff --git a/src/lib/server/exfile.c b/src/lib/server/exfile.c index 542d466b51..e0de5da7e6 100644 --- a/src/lib/server/exfile.c +++ b/src/lib/server/exfile.c @@ -66,7 +66,7 @@ struct exfile_s { * @param[in] entry for the file that the event occurred on. * @param[in] name_suffix trigger name suffix. */ -static inline void exfile_trigger_exec(exfile_t *ef, exfile_entry_t *entry, char const *name_suffix) +static inline void exfile_trigger(exfile_t *ef, exfile_entry_t *entry, char const *name_suffix) { char name[128]; fr_pair_t *vp; @@ -91,7 +91,7 @@ static inline void exfile_trigger_exec(exfile_t *ef, exfile_entry_t *entry, char talloc_array_length(entry->filename) - 1, false); snprintf(name, sizeof(name), "%s.%s", ef->trigger_prefix, name_suffix); - trigger_exec(unlang_interpret_get_thread_default(), ef->conf, name, false, &args); + trigger(unlang_interpret_get_thread_default(), ef->conf, name, false, &args); fr_pair_list_free(&args); } @@ -107,7 +107,7 @@ static void exfile_cleanup_entry(exfile_t *ef, exfile_entry_t *entry) /* * Issue close trigger *after* we've closed the fd */ - exfile_trigger_exec(ef, entry, "close"); + exfile_trigger(ef, entry, "close"); /* * Trigger still needs access to filename to populate Exfile-Name @@ -381,7 +381,7 @@ reopen: ef->entries[i].fd = exfile_open_mkdir(ef, filename, permissions); if (ef->entries[i].fd < 0) goto error; - exfile_trigger_exec(ef, &ef->entries[i], "open"); + exfile_trigger(ef, &ef->entries[i], "open"); try_lock: /* @@ -483,7 +483,7 @@ try_lock: */ ef->entries[i].last_used = now; - exfile_trigger_exec(ef, &ef->entries[i], "reserve"); + exfile_trigger(ef, &ef->entries[i], "reserve"); /* coverity[missing_unlock] */ return ef->entries[i].fd; @@ -536,7 +536,7 @@ static int exfile_close_lock(exfile_t *ef, int fd) (void) rad_unlockfd(ef->entries[i].fd, 0); pthread_mutex_unlock(&(ef->mutex)); - exfile_trigger_exec(ef, &ef->entries[i], "release"); + exfile_trigger(ef, &ef->entries[i], "release"); return 0; } diff --git a/src/lib/server/main_loop.c b/src/lib/server/main_loop.c index 5ac0235a02..897b786099 100644 --- a/src/lib/server/main_loop.c +++ b/src/lib/server/main_loop.c @@ -133,7 +133,7 @@ static void main_loop_signal_process(int flag) last_hup = when; - trigger_exec(unlang_interpret_get_thread_default(), NULL, "server.signal.hup", true, NULL); + trigger(unlang_interpret_get_thread_default(), NULL, "server.signal.hup", true, NULL); fr_event_loop_exit(event_list, 0x80); } } diff --git a/src/lib/server/pool.c b/src/lib/server/pool.c index 41007f475d..280e424e35 100644 --- a/src/lib/server/pool.c +++ b/src/lib/server/pool.c @@ -256,7 +256,7 @@ static void connection_link_head(fr_pool_t *pool, fr_pool_connection_t *this) * @param[in] pool to send trigger for. * @param[in] event trigger name suffix. */ -static inline void fr_pool_trigger_exec(fr_pool_t *pool, char const *event) +static inline void fr_pool_trigger(fr_pool_t *pool, char const *event) { char name[128]; @@ -266,7 +266,7 @@ static inline void fr_pool_trigger_exec(fr_pool_t *pool, char const *event) if (!pool->triggers_enabled) return; snprintf(name, sizeof(name), "%s.%s", pool->trigger_prefix, event); - trigger_exec(unlang_interpret_get_thread_default(), pool->cs, name, true, &pool->trigger_args); + trigger(unlang_interpret_get_thread_default(), pool->cs, name, true, &pool->trigger_args); } /** Find a connection handle in the connection list @@ -454,7 +454,7 @@ static fr_pool_connection_t *connection_spawn(fr_pool_t *pool, request_t *reques * Must be done inside the mutex, reconnect callback * may modify args. */ - fr_pool_trigger_exec(pool, "fail"); + fr_pool_trigger(pool, "fail"); pthread_cond_broadcast(&pool->done_spawn); pthread_mutex_unlock(&pool->mutex); @@ -524,7 +524,7 @@ static fr_pool_connection_t *connection_spawn(fr_pool_t *pool, request_t *reques * Must be done inside the mutex, reconnect callback * may modify args. */ - fr_pool_trigger_exec(pool, "open"); + fr_pool_trigger(pool, "open"); pthread_cond_broadcast(&pool->done_spawn); if (unlock) pthread_mutex_unlock(&pool->mutex); @@ -567,7 +567,7 @@ static void connection_close_internal(fr_pool_t *pool, fr_pool_connection_t *thi fr_heap_extract(&pool->heap, this); } - fr_pool_trigger_exec(pool, "close"); + fr_pool_trigger(pool, "close"); connection_unlink(pool, this); @@ -879,7 +879,7 @@ static void *connection_get_internal(fr_pool_t *pool, request_t *request, bool s * Must be done inside the mutex, reconnect callback * may modify args. */ - fr_pool_trigger_exec(pool, "none"); + fr_pool_trigger(pool, "none"); } return NULL; @@ -1137,7 +1137,7 @@ int fr_pool_start(fr_pool_t *pool) } } - fr_pool_trigger_exec(pool, "start"); + fr_pool_trigger(pool, "start"); return 0; } @@ -1291,7 +1291,7 @@ int fr_pool_reconnect(fr_pool_t *pool, request_t *request) * Must be done inside the mutex, reconnect callback * may modify args. */ - fr_pool_trigger_exec(pool, "reconnect"); + fr_pool_trigger(pool, "reconnect"); /* * Allow new spawn attempts, and wakeup any threads @@ -1353,7 +1353,7 @@ void fr_pool_free(fr_pool_t *pool) connection_close_internal(pool, this); } - fr_pool_trigger_exec(pool, "stop"); + fr_pool_trigger(pool, "stop"); fr_assert(pool->head == NULL); fr_assert(pool->tail == NULL); @@ -1466,8 +1466,8 @@ void fr_pool_connection_release(fr_pool_t *pool, request_t *request, void *conn) */ connection_check(pool, request); - if (trigger_min) fr_pool_trigger_exec(pool, "min"); - if (trigger_max) fr_pool_trigger_exec(pool, "max"); + if (trigger_min) fr_pool_trigger(pool, "min"); + if (trigger_max) fr_pool_trigger(pool, "max"); } /** Reconnect a suspected inviable connection diff --git a/src/lib/server/trigger.c b/src/lib/server/trigger.c index 0d27514f93..e5b979bfcb 100644 --- a/src/lib/server/trigger.c +++ b/src/lib/server/trigger.c @@ -47,9 +47,6 @@ static CONF_SECTION const *trigger_cs; static fr_rb_tree_t *trigger_last_fired_tree; static pthread_mutex_t *trigger_mutex; -#define REQUEST_INDEX_TRIGGER_NAME 1 -#define REQUEST_INDEX_TRIGGER_ARGS 2 - /** Describes a rate limiting entry for a trigger * */ @@ -73,54 +70,6 @@ fr_dict_attr_autoload_t trigger_dict_attr[] = { { NULL } }; -xlat_arg_parser_t const trigger_xlat_args[] = { - { .required = true, .single = true, .type = FR_TYPE_STRING }, - XLAT_ARG_PARSER_TERMINATOR -}; - -/** Retrieve attributes from a special trigger list - * - */ -xlat_action_t trigger_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, - UNUSED xlat_ctx_t const *xctx, - request_t *request, fr_value_box_list_t *in) -{ - fr_pair_list_t *head = NULL; - fr_dict_attr_t const *da; - fr_pair_t *vp; - fr_value_box_t *in_head = fr_value_box_list_head(in); - fr_value_box_t *vb; - - if (!trigger_cs) { - ERROR("Triggers are not enabled"); - return XLAT_ACTION_FAIL; - } - - if (!request_data_reference(request, &trigger_cs, REQUEST_INDEX_TRIGGER_NAME)) { - ERROR("trigger xlat may only be used in a trigger command"); - return XLAT_ACTION_FAIL; - } - - head = request_data_reference(request, &trigger_cs, REQUEST_INDEX_TRIGGER_ARGS); - - da = fr_dict_attr_by_name(NULL, fr_dict_root(request->local_dict), in_head->vb_strvalue); - if (!da) { - ERROR("Unknown attribute \"%pV\"", in_head); - return XLAT_ACTION_FAIL; - } - - vp = fr_pair_find_by_da(head, NULL, da); - if (!vp) { - ERROR("Attribute \"%pV\" is not valid for this trigger", in_head); - return XLAT_ACTION_FAIL; - } - - MEM(vb = fr_value_box_alloc_null(ctx)); - fr_value_box_copy(vb, vb, &vp->data); - fr_dcursor_append(out, vb); - return XLAT_ACTION_DONE; -} - static void _trigger_last_fired_free(void *data) { talloc_free(data); @@ -148,19 +97,19 @@ bool trigger_enabled(void) } typedef struct { - fr_value_box_list_t args; //!< Arguments to pass to the trigger exec. fr_value_box_list_t out; //!< result of the xlap (which we ignore) unlang_result_t result; //!< the result of expansion - int exec_status; + tmpl_t *vpt; //!< the template to execute + int exec_status; //!< Result of the program (if the trigger is a tmpl) } fr_trigger_t; /** Execute a trigger - call an executable to process an event * * A trigger ties a state change (e.g. connection up) in a module to an action * (e.g. send an SNMP trap) defined in raqddb/triggers.conf or in the trigger - * section of a module, and can be created with one call to trigger_exec(). + * section of a module, and can be created with one call to trigger(). * - * The trigger_exec function expands the configuration item, and runs the given + * The trigger function expands the configuration item, and runs the given * function (exec, sql insert, etc.) asynchronously, allowing the server to * keep processing packets while the action is being taken. * @@ -175,7 +124,7 @@ typedef struct { * In contrast, triggers are something specific which the administrator needs * to be notified about immediately and can't wait to post-process a log file. * - * @note Calls to this function will be ignored if #trigger_exec_init has not been called. + * @note Calls to this function will be ignored if #trigger_init has not been called. * * @param[in] intp Interpreter to run the trigger with. If this is NULL the * trigger will be executed synchronously. @@ -191,8 +140,8 @@ typedef struct { * - 0 on success. * - -1 on failure. */ -int trigger_exec(unlang_interpret_t *intp, - CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args) +int trigger(unlang_interpret_t *intp, + CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args) { CONF_ITEM *ci; CONF_PAIR *cp; @@ -205,12 +154,10 @@ int trigger_exec(unlang_interpret_t *intp, ssize_t slen; fr_event_list_t *el; - xlat_exp_head_t *xlat; tmpl_rules_t t_rules; - fr_token_t quote; /* - * noop if trigger_exec_init was never called, or if + * noop if trigger_init was never called, or if * we're just checking the configuration. */ if (!trigger_cs || check_config) return 0; @@ -314,38 +261,23 @@ int trigger_exec(unlang_interpret_t *intp, */ request = request_local_alloc_internal(NULL, (&(request_init_args_t){ .detachable = true })); - /* - * Add the args to the request data, so they can be picked up by the - * trigger_xlat function. - */ if (args) { - fr_pair_list_t *local_args; fr_pair_t *vp; - MEM(local_args = talloc_zero(request, fr_pair_list_t)); - fr_pair_list_init(local_args); - if (fr_pair_list_copy(local_args, local_args, args) < 0) { + if (fr_pair_list_copy(request->request_ctx, &request->request_pairs, args) < 0) { PERROR("Failed copying trigger arguments"); - args_error: talloc_free(request); return -1; } + /* + * Add the trigger name to the request data + */ MEM(pair_append_request(&vp, attr_trigger_name) >= 0); fr_pair_value_strdup(vp, cf_pair_value(cp), false); - - if (request_data_add(request, &trigger_cs, REQUEST_INDEX_TRIGGER_ARGS, local_args, - false, false, false) < 0) goto args_error; - } - - if (request_data_add(request, &trigger_cs, REQUEST_INDEX_TRIGGER_NAME, - UNCONST(char *, name), false, false, false) < 0) { - talloc_free(request); - return -1; } MEM(trigger = talloc_zero(request, fr_trigger_t)); - fr_value_box_list_init(&trigger->args); fr_value_box_list_init(&trigger->out); el = unlang_interpret_event_list(request); @@ -362,22 +294,14 @@ int trigger_exec(unlang_interpret_t *intp, .at_runtime = true, }; - quote = cf_pair_value_quote(cp); - - /* - * Parse the xlat as appropriate. - */ - if (quote != T_BACK_QUOTED_STRING) { - slen = xlat_tokenize(trigger, &xlat, &FR_SBUFF_IN(value, talloc_array_length(value) - 1), NULL, &t_rules); - } else { - slen = xlat_tokenize_argv(trigger, &xlat, &FR_SBUFF_IN(value, talloc_array_length(value) - 1), NULL, NULL, &t_rules, true); - } + slen = tmpl_afrom_substr(trigger, &trigger->vpt, &FR_SBUFF_IN(value, talloc_strlen(value)), + cf_pair_value_quote(cp), NULL, &t_rules); if (slen <= 0) { char *spaces, *text; fr_canonicalize_error(trigger, &spaces, &text, slen, value); - cf_log_err(cp, "Failed parsing trigger command"); + cf_log_err(cp, "Failed parsing trigger expresion"); cf_log_err(cp, "%s", text); cf_log_perr(cp, "%s^", spaces); @@ -387,39 +311,27 @@ int trigger_exec(unlang_interpret_t *intp, return -1; } - fr_assert(xlat != NULL); - - if (quote != T_BACK_QUOTED_STRING) { - if (unlang_xlat_push(trigger, &trigger->result, &trigger->out, request, xlat, true) < 0) { - fail_expand: - DEBUG("Failed expanding trigger - %s", fr_strerror()); - talloc_free(request); - return -1; - } - } else { - tmpl_t *vpt; - + if (!tmpl_is_exec(trigger->vpt) && !tmpl_is_xlat(trigger->vpt)) { /* - * We need back-ticks, because it's just so much - * easier than anything else. - * - * @todo - define %exec.string() function, which - * splits the string, and THEN expands it. That - * would be much simpler than this stuff. + * We only support exec and xlat templates. + * Anything else is an error. */ - MEM(vpt = tmpl_alloc(trigger, TMPL_TYPE_EXEC, quote, value, talloc_array_length(value))); - tmpl_set_xlat(vpt, xlat); - - if (unlang_tmpl_push(trigger, NULL, &trigger->out, request, vpt, - &(unlang_tmpl_args_t) { - .type = UNLANG_TMPL_ARGS_TYPE_EXEC, - .exec = { - .status_out = &trigger->exec_status, - .timeout = fr_time_delta_from_sec(1), - }, - }) < 0) { - goto fail_expand; - } + cf_log_err(cp, "Trigger must be an \"expr\" or `exec`"); + talloc_free(request); + return -1; + } + + fr_assert(trigger->vpt != NULL); + + if (unlang_tmpl_push(trigger, &trigger->result, &trigger->out, request, trigger->vpt, + &(unlang_tmpl_args_t) { + .type = UNLANG_TMPL_ARGS_TYPE_EXEC, + .exec = { + .status_out = &trigger->exec_status, + .timeout = fr_time_delta_from_sec(5), + }, + }) < 0) { + talloc_free(request); } /* @@ -474,7 +386,7 @@ int trigger_exec(unlang_interpret_t *intp, /** Create trigger arguments to describe the server the pool connects to * - * @note #trigger_exec_init must be called before calling this function, + * @note #trigger_init must be called before calling this function, * else it will return NULL. * * @param[in] ctx to allocate fr_pair_t s in. @@ -518,7 +430,7 @@ static int _mutex_free(pthread_mutex_t *mutex) /** Free trigger resources * */ -static int _trigger_exec_free(UNUSED void *uctx) +static int _trigger_free(UNUSED void *uctx) { fr_dict_autofree(trigger_dict); TALLOC_FREE(trigger_last_fired_tree); @@ -527,7 +439,7 @@ static int _trigger_exec_free(UNUSED void *uctx) return 0; } -/** Set the global trigger section trigger_exec will search in, and register xlats +/** Set the global trigger section trigger will search in, and register xlats * * This function exists because triggers are used by the connection pool, which * is used in the server library which may not have the mainconfig available. @@ -541,7 +453,7 @@ static int _trigger_exec_free(UNUSED void *uctx) * - 0 on success. * - -1 on failure. */ -static int _trigger_exec_init(void *cs_arg) +static int _trigger_init(void *cs_arg) { CONF_SECTION *cs; @@ -577,11 +489,11 @@ static int _trigger_exec_init(void *cs_arg) return 0; } -int trigger_exec_init(CONF_SECTION const *cs) +int trigger_init(CONF_SECTION const *cs) { int ret; - fr_atexit_global_once_ret(&ret, _trigger_exec_init, _trigger_exec_free, UNCONST(CONF_SECTION *, cs)); + fr_atexit_global_once_ret(&ret, _trigger_init, _trigger_free, UNCONST(CONF_SECTION *, cs)); return ret; } diff --git a/src/lib/server/trigger.h b/src/lib/server/trigger.h index 5756656992..de2c36ed9f 100644 --- a/src/lib/server/trigger.h +++ b/src/lib/server/trigger.h @@ -36,15 +36,9 @@ extern "C" { #include #include -extern xlat_arg_parser_t const trigger_xlat_args[]; +int trigger_init(CONF_SECTION const *cs); -xlat_action_t trigger_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, - UNUSED xlat_ctx_t const *xctx, - request_t *request, fr_value_box_list_t *in); - -int trigger_exec_init(CONF_SECTION const *cs); - -int trigger_exec(unlang_interpret_t *intp, +int trigger(unlang_interpret_t *intp, CONF_SECTION const *cs, char const *name, bool rate_limit, fr_pair_list_t *args) CC_HINT(nonnull(3)); diff --git a/src/lib/server/trunk.c b/src/lib/server/trunk.c index 74726987fb..8fec7e8557 100644 --- a/src/lib/server/trunk.c +++ b/src/lib/server/trunk.c @@ -431,7 +431,7 @@ static size_t trunk_connection_events_len = NUM_ELEMENTS(trunk_connection_events #define CONN_TRIGGER(_state) do { \ if (trunk->pub.triggers) { \ - trigger_exec(unlang_interpret_get_thread_default(), \ + trigger(unlang_interpret_get_thread_default(), \ NULL, fr_table_str_by_value(trunk_conn_trigger_names, _state, \ ""), true, NULL); \ } \ @@ -462,7 +462,7 @@ void trunk_request_state_log_entry_add(char const *function, int line, #define REQUEST_TRIGGER(_state) do { \ if (trunk->pub.triggers) { \ - trigger_exec(unlang_interpret_get_thread_default(), \ + trigger(unlang_interpret_get_thread_default(), \ NULL, fr_table_str_by_value(trunk_req_trigger_names, _state, \ ""), true, NULL); \ } \ diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index e7c6845f96..6afdbfe9eb 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -4485,7 +4485,6 @@ do { \ XLAT_REGISTER_VOID("time.offset", xlat_func_time_offset, FR_TYPE_TIME_DELTA); XLAT_REGISTER_VOID("time.is_dst", xlat_func_time_is_dst, FR_TYPE_BOOL); - XLAT_REGISTER_ARGS("trigger", trigger_xlat, FR_TYPE_STRING, trigger_xlat_args); XLAT_REGISTER_ARGS("base64.encode", xlat_func_base64_encode, FR_TYPE_STRING, xlat_func_base64_encode_arg); XLAT_REGISTER_ARGS("base64.decode", xlat_func_base64_decode, FR_TYPE_OCTETS, xlat_func_base64_decode_arg); XLAT_REGISTER_ARGS("rand", xlat_func_rand, FR_TYPE_UINT64, xlat_func_rand_arg); diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index eed9bcd030..38df4ffb5f 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -1630,7 +1630,7 @@ fr_slen_t xlat_tokenize_argv(TALLOC_CTX *ctx, xlat_exp_head_t **out, fr_sbuff_t }; our_p_rules = &tmp_p_rules; } else { - our_p_rules = &value_parse_rules_bareword_quoted; + our_p_rules = &value_parse_rules_bareword_quoted; } } else { diff --git a/src/listen/ldap_sync/active_directory.c b/src/listen/ldap_sync/active_directory.c index 56b1537922..f65755421e 100644 --- a/src/listen/ldap_sync/active_directory.c +++ b/src/listen/ldap_sync/active_directory.c @@ -142,7 +142,7 @@ int active_directory_sync_state_init(fr_ldap_connection_t *conn, size_t sync_no, DEBUG3("Sync created with base dn \"%s\", filter \"%s\", msgid %i", sync->config->base_dn, sync->config->filter, sync->msgid); - trigger_exec(unlang_interpret_get_thread_default(), config->cs, "ldap_sync.start", true, &sync->trigger_args); + trigger(unlang_interpret_get_thread_default(), config->cs, "ldap_sync.start", true, &sync->trigger_args); return 0; } diff --git a/src/listen/ldap_sync/persistent_search.c b/src/listen/ldap_sync/persistent_search.c index f0acacf7d7..48f0c4cc67 100644 --- a/src/listen/ldap_sync/persistent_search.c +++ b/src/listen/ldap_sync/persistent_search.c @@ -130,7 +130,7 @@ int persistent_sync_state_init(fr_ldap_connection_t *conn, size_t sync_no, proto DEBUG3("Sync created with base dn \"%s\", filter \"%s\", msgid %i", sync->config->base_dn, sync->config->filter, sync->msgid); - trigger_exec(unlang_interpret_get_thread_default(), config->cs, "ldap_sync.start", true, &sync->trigger_args); + trigger(unlang_interpret_get_thread_default(), config->cs, "ldap_sync.start", true, &sync->trigger_args); /* * Register event to store cookies at a regular interval diff --git a/src/listen/ldap_sync/proto_ldap_sync_ldap.c b/src/listen/ldap_sync/proto_ldap_sync_ldap.c index 64554a7be4..0b4bc35320 100644 --- a/src/listen/ldap_sync/proto_ldap_sync_ldap.c +++ b/src/listen/ldap_sync/proto_ldap_sync_ldap.c @@ -163,7 +163,7 @@ static int sync_state_free(sync_state_t *sync) DEBUG3("Abandoning sync base dn \"%s\", filter \"%s\"", sync->config->base_dn, sync->config->filter); - trigger_exec(unlang_interpret_get_thread_default(), sync->config->cs, "ldap_sync.stop", true, &sync->trigger_args); + trigger(unlang_interpret_get_thread_default(), sync->config->cs, "ldap_sync.stop", true, &sync->trigger_args); if (!sync->conn->handle) return 0; /* Handled already closed? */ diff --git a/src/listen/ldap_sync/rfc4533.c b/src/listen/ldap_sync/rfc4533.c index 3ddb478463..c4316a80fc 100644 --- a/src/listen/ldap_sync/rfc4533.c +++ b/src/listen/ldap_sync/rfc4533.c @@ -147,7 +147,7 @@ int rfc4533_sync_init(fr_ldap_connection_t *conn, size_t sync_no, proto_ldap_syn DEBUG3("Sync created with base dn \"%s\", filter \"%s\", msgid %i", sync->config->base_dn, sync->config->filter, sync->msgid); - trigger_exec(unlang_interpret_get_thread_default(), config->cs, "ldap_sync.start", true, &sync->trigger_args); + trigger(unlang_interpret_get_thread_default(), config->cs, "ldap_sync.start", true, &sync->trigger_args); /* * Register event to store cookies at a regular interval diff --git a/src/modules/rlm_test/rlm_test.c b/src/modules/rlm_test/rlm_test.c index a94a3d9d95..f65456a0fc 100644 --- a/src/modules/rlm_test/rlm_test.c +++ b/src/modules/rlm_test/rlm_test.c @@ -356,7 +356,7 @@ static xlat_action_t trigger_test_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_BOOL, NULL)); fr_dcursor_append(out, vb); - if (trigger_exec(unlang_interpret_get(request), NULL, in_head->vb_strvalue, false, NULL) < 0) { + if (trigger(unlang_interpret_get(request), NULL, in_head->vb_strvalue, false, NULL) < 0) { RPEDEBUG("Running trigger failed"); vb->vb_bool = false; return XLAT_ACTION_FAIL; -- 2.47.3