]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only pair rules need to have a destination
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 12 Dec 2017 21:15:30 +0000 (21:15 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 12 Dec 2017 21:15:30 +0000 (21:15 +0000)
src/main/cf_parse.c

index a99e38b4e5f054df2de0db82b7a43dc6e542603f..77edfb7ad7c6b4990757a3e724e2e44076932e08 100644 (file)
@@ -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.