From: Arran Cudbard-Bell Date: Sun, 12 Feb 2023 18:06:58 +0000 (-0600) Subject: linelog: We no longer require format or ref as we can call the module via an xlat X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=affeb25d290caadb2ea8041397bea06fa31e2317;p=thirdparty%2Ffreeradius-server.git linelog: We no longer require format or ref as we can call the module via an xlat --- diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index 32c90d469dd..4872e203597 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -559,6 +559,11 @@ static unlang_action_t CC_HINT(nonnull) mod_do_linelog(rlm_rcode_t *p_result, mo size_t vector_len; bool with_delim; + if (!inst->log_src && !inst->log_ref) { + cf_log_err(conf, "A 'format', or 'reference' configuration item must be set to call this module"); + RETURN_MODULE_FAIL; + } + buff[0] = '.'; /* force to be in current section (by default) */ buff[1] = '\0'; buff[2] = '\0'; @@ -777,11 +782,6 @@ static int mod_instantiate(module_inst_ctx_t const *mctx) return -1; } - if (!inst->log_src && !inst->log_ref) { - cf_log_err(conf, "Must specify a log format, or reference"); - return -1; - } - snprintf(prefix, sizeof(prefix), "rlm_linelog (%s)", mctx->inst->name); /*