From: Alan T. DeKok Date: Sat, 14 Nov 2009 09:29:40 +0000 (+0100) Subject: Make templates work again X-Git-Tag: release_2_1_8~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61215d3baccf7f44337e84f92caecab007b8ea40;p=thirdparty%2Ffreeradius-server.git Make templates work again --- diff --git a/src/main/conffile.c b/src/main/conffile.c index 406285bae64..b391c22fb47 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -1462,12 +1462,19 @@ static int cf_section_read(const char *filename, int *lineno, FILE *fp, if (strcasecmp(buf1, "$template") == 0) { CONF_ITEM *ci; - CONF_SECTION *parentcs; + CONF_SECTION *parentcs, *templatecs; t2 = getword(&ptr, buf2, sizeof(buf2)); parentcs = cf_top_section(current); - ci = cf_reference_item(parentcs, this, buf2); + templatecs = cf_section_sub_find(parentcs, "templates"); + if (!templatecs) { + radlog(L_ERR, "%s[%d]: No \"templates\" section for reference \"%s\"", + filename, *lineno, buf2); + return -1; + } + + ci = cf_reference_item(parentcs, templatecs, buf2); if (!ci || (ci->type != CONF_ITEM_SECTION)) { radlog(L_ERR, "%s[%d]: Reference \"%s\" not found", filename, *lineno, buf2);