From: Arran Cudbard-Bell Date: Tue, 12 Dec 2017 21:15:30 +0000 (+0000) Subject: Only pair rules need to have a destination X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d714af4fdaf2df90458980cbc377b0ea4c393772;p=thirdparty%2Ffreeradius-server.git Only pair rules need to have a destination --- diff --git a/src/main/cf_parse.c b/src/main/cf_parse.c index a99e38b4e5f..77edfb7ad7c 100644 --- a/src/main/cf_parse.c +++ b/src/main/cf_parse.c @@ -1089,11 +1089,6 @@ int cf_section_parse(TALLOC_CTX *ctx, void *base, CONF_SECTION *cs) data = ((uint8_t *)base) + rule->offset; } - if (!data) { - cf_log_err(cs, "Rule doesn't specify output destination"); - return -1; - } - /* * Handle subsections specially */ @@ -1103,6 +1098,16 @@ int cf_section_parse(TALLOC_CTX *ctx, void *base, CONF_SECTION *cs) continue; } /* else it's a CONF_PAIR */ + /* + * Pair either needs an output destination or + * there needs to be a function associated with + * it. + */ + if (!data && !rule->func) { + cf_log_err(cs, "Rule doesn't specify output destination"); + return -1; + } + /* * Get pointer to where we need to write out * whether the pointer was set.