]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
disallow create inside of create
authorAlan T. DeKok <aland@freeradius.org>
Tue, 12 Sep 2017 13:50:43 +0000 (09:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 12 Sep 2017 13:50:43 +0000 (09:50 -0400)
src/main/unlang_compile.c

index 4c9e7a11c522a6f5eec1ea16e9fea72b3ea97755..da03c4f152923aefc16f6fe27461c4ca4504da3b 100644 (file)
@@ -2514,6 +2514,19 @@ static unlang_t *compile_create(unlang_t *parent, unlang_compile_t *unlang_ctx,
        unlang_t *c;
        unlang_group_t *g;
 
+       /*
+        *      async async is not allowed.  It will work, but we
+        *      don't know what it means.  If someone has a good
+        *      use-case, we can try enabling it.
+        */
+       for (c = parent; c != NULL; c = c->parent) {
+               if (c->type == UNLANG_TYPE_CREATE) {
+                       cf_log_err(cs, "'%s' sections cannot be nested inside of other '%s' sections",
+                                  unlang_ops[mod_type].name, unlang_ops[mod_type].name);
+                       return NULL;
+               }
+       }       
+
        g = group_allocate(parent, cs, group_type, mod_type);
        if (!g) return NULL;