#define PW_TYPE_DEPRECATED (1 << 10)
#define PW_TYPE_REQUIRED (1 << 11)
#define PW_TYPE_ATTRIBUTE (1 << 12)
+#define PW_TYPE_NO_OVERWRITE (1 << 13)
typedef struct CONF_PARSER {
char const *name;
int cf_item_parse(CONF_SECTION *cs, char const *name, int type, void *data, char const *dflt)
{
int rcode;
- bool deprecated, required, attribute;
+ bool deprecated, required, attribute, no_overwrite;
char **q;
char const *value;
fr_ipaddr_t ipaddr;
deprecated = (type & PW_TYPE_DEPRECATED);
required = (type & PW_TYPE_REQUIRED);
attribute = (type & PW_TYPE_ATTRIBUTE);
+ no_overwrite = (type & PW_TYPE_NO_OVERWRITE);
type &= 0xff; /* normal types are small */
rcode = 0;
case PW_TYPE_STRING_PTR:
q = (char **) data;
if (*q != NULL) {
+ /*
+ * Don't over-write something we got from
+ * the command line.
+ */
+ if (no_overwrite) {
+ cf_log_info(cs, "%.*s\t%s = \"%s\"",
+ cs->depth, parse_spaces, name, *q);
+ break;
+ }
+
talloc_free(*q);
}
{ "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"},
+ { "dict_dir", PW_TYPE_STRING_PTR | PW_TYPE_NO_OVERWRITE, 0,
+ &mainconfig.dictionary_dir, "${prefix}/share" },
{ "radacctdir", PW_TYPE_STRING_PTR, 0, &radacct_dir, "${logdir}/radacct" },
{ "hostname_lookups", PW_TYPE_BOOLEAN, 0, &fr_dns_lookups, "no" },
{ "max_request_time", PW_TYPE_INTEGER, 0, &mainconfig.max_request_time, STRINGIFY(MAX_REQUEST_TIME) },