]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
linelog: We no longer require format or ref as we can call the module via an xlat
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 12 Feb 2023 18:06:58 +0000 (12:06 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 12 Feb 2023 18:06:58 +0000 (12:06 -0600)
src/modules/rlm_linelog/rlm_linelog.c

index 32c90d469dd7557ea5f3bbe5c0243a5a02e00c3f..4872e20359763a3f248998c4059262946695734c 100644 (file)
@@ -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);
 
        /*