/*
* FIXME: sizeof(buffer)?
*/
- value = cf_expand_variables("?",
+ value = cf_expand_variables("<internal>",
&lineno,
cs, buffer, value);
- if (!value) return -1;
+ if (!value) {
+ cf_log_err(cf_sectiontoitem(cs),"Failed expanding variable %s", name);
+ return -1;
+ }
}
cf_log_info(cs, "\t%s = \"%s\"", name, value ? value : "(null)");
default:
radlog(L_ERR, "type %d not supported yet", type);
return -1;
- break;
} /* switch over variable type */
+ if (!cp) {
+ CONF_PAIR *cpn;
+
+ cpn = cf_pair_alloc(name, value, T_OP_SET, T_BARE_WORD, cs);
+ cpn->item.filename = "<internal>";
+ cpn->item.lineno = 0;
+ cf_item_add(cs, cf_pairtoitem(cpn));
+ }
+
return rcode;
}
*/
static const char *localstatedir = NULL;
static const char *prefix = NULL;
+static const char *my_name = NULL;
+static const char *sbindir = NULL;
+static const char *run_dir = NULL;
static char *syslog_facility = NULL;
static const FR_NAME_NUMBER str2fac[] = {
#ifdef LOG_KERN
* hard-coded defines for the locations of the various
* files.
*/
+ { "name", PW_TYPE_STRING_PTR, 0, &my_name, "radiusd"},
{ "prefix", PW_TYPE_STRING_PTR, 0, &prefix, "/usr/local"},
{ "localstatedir", PW_TYPE_STRING_PTR, 0, &localstatedir, "${prefix}/var"},
+ { "sbindir", PW_TYPE_STRING_PTR, 0, &sbindir, "${prefix}/sbin"},
{ "logdir", PW_TYPE_STRING_PTR, 0, &radlog_dir, "${localstatedir}/log"},
+ { "run_dir", PW_TYPE_STRING_PTR, 0, &run_dir, "${localstatedir}/run/${name}"},
{ "libdir", PW_TYPE_STRING_PTR, 0, &radlib_dir, "${prefix}/lib"},
{ "radacctdir", PW_TYPE_STRING_PTR, 0, &radacct_dir, "${logdir}/radacct" },
{ "hostname_lookups", PW_TYPE_BOOLEAN, 0, &fr_dns_lookups, "no" },