From: Alan T. DeKok Date: Thu, 14 Sep 2017 17:47:00 +0000 (-0400) Subject: "call" can only be used in a "subrequest" section. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ff098ca5ecc55fac4711b2a2d49de6071ae1802;p=thirdparty%2Ffreeradius-server.git "call" can only be used in a "subrequest" section. For now, until we get more code written --- diff --git a/src/main/unlang_compile.c b/src/main/unlang_compile.c index aee3c8c9ae0..124ca89855d 100644 --- a/src/main/unlang_compile.c +++ b/src/main/unlang_compile.c @@ -2568,6 +2568,21 @@ static unlang_t *compile_call(unlang_t *parent, unlang_compile_t *unlang_ctx, CO char *packet; CONF_SECTION *server_cs, *root; + /* + * calls with a normal packet are 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_SUBREQUEST) break; + } + + if (!c) { + cf_log_err(cs, "'%s' can only be used inside of a 'subrequest' section", + unlang_ops[mod_type].name); + return NULL; + } + name2 = cf_section_name2(cs); if (!name2) { cf_log_err(cs, "'call' must be given with a server.PACKET argument");