From: Alan T. DeKok Date: Tue, 12 Sep 2017 13:50:43 +0000 (-0400) Subject: disallow create inside of create X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efc0e8612ab5bc394b8fbeb0fd9e2ec3ff6c4133;p=thirdparty%2Ffreeradius-server.git disallow create inside of create --- diff --git a/src/main/unlang_compile.c b/src/main/unlang_compile.c index 4c9e7a11c52..da03c4f1529 100644 --- a/src/main/unlang_compile.c +++ b/src/main/unlang_compile.c @@ -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;