/*
* Copyright (C) 2006-2009 Stig Venaas <venaas@uninett.no>
- * Copyright (C) 2010, 2011 NORDUnet A/S
+ * Copyright (C) 2010,2011,2012 NORDUnet A/S
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
!mergeconfstring(&dst->matchcertattr, &src->matchcertattr) ||
!mergeconfstring(&dst->confrewritein, &src->confrewritein) ||
!mergeconfstring(&dst->confrewriteout, &src->confrewriteout) ||
- !mergeconfstring(&dst->dynamiclookupcommand, &src->dynamiclookupcommand))
+ !mergeconfstring(&dst->confrewriteusername, &src->confrewriteusername) ||
+ !mergeconfstring(&dst->dynamiclookupcommand, &src->dynamiclookupcommand) ||
+ !mergeconfstring(&dst->fticks_viscountry, &src->fticks_viscountry) ||
+ !mergeconfstring(&dst->fticks_visinst, &src->fticks_visinst))
return 0;
if (src->pdef)
dst->pdef = src->pdef;
"rewriteattribute", CONF_STR, &conf->confrewriteusername,
#if defined(WANT_FTICKS)
"fticksVISCOUNTRY", CONF_STR, &conf->fticks_viscountry,
+ "fticksVISINST", CONF_STR, &conf->fticks_visinst,
#endif
NULL
))
if (!addhostport(&conf->hostports, conf->hostsrc, conf->pdef->portdefault, 1) ||
!resolvehostports(conf->hostports, conf->pdef->socktype))
- debugx(1, DBG_ERR, "resolve failed, exiting");
+ debugx(1, DBG_ERR, "%s: resolve failed, exiting", __func__);
if (!conf->secret) {
if (!conf->pdef->secretdefault)
}
if (!conf->dynamiclookupcommand && !resolvehostports(conf->hostports, conf->pdef->socktype)) {
- debug(DBG_ERR, "resolve failed, exiting");
+ debug(DBG_ERR, "%s: resolve failed", __func__);
return 0;
}
return 1;
if (resconf || !conf->dynamiclookupcommand) {
if (!compileserverconfig(conf, block))
- goto errexit;
+ return 0; /* Don't goto errexit and free resconf -- it's
+ * not ours to free. */
}
if (!conf->secret) {
"ListenDTLS", CONF_MSTR, &listenargs[RAD_DTLS],
"SourceDTLS", CONF_STR, &sourcearg[RAD_DTLS],
#endif
+ "PidFile", CONF_STR, &options.pidfile,
"TTLAttribute", CONF_STR, &options.ttlattr,
"addTTL", CONF_LINT, &addttl,
"LogLevel", CONF_LINT, &loglevel,
"FTicksReporting", CONF_STR, &fticks_reporting_str,
"FTicksMAC", CONF_STR, &fticks_mac_str,
"FTicksKey", CONF_STR, &fticks_key_str,
+ "FTicksSyslogFacility", CONF_STR, &options.ftickssyslogfacility,
#endif
NULL
))
options.loglevel = loglevel;
else if (options.loglevel)
debug_set_level(options.loglevel);
- if (!foreground)
- debug_set_destination(options.logdestination ? options.logdestination : "x-syslog:///");
+ if (!foreground) {
+ debug_set_destination(options.logdestination
+ ? options.logdestination
+ : "x-syslog:///", LOG_TYPE_DEBUG);
+#if defined(WANT_FTICKS)
+ if (options.ftickssyslogfacility) {
+ debug_set_destination(options.ftickssyslogfacility,
+ LOG_TYPE_FTICKS);
+ free(options.ftickssyslogfacility);
+ }
+#endif
+ }
free(options.logdestination);
if (!list_first(clconfs))
debug_timestamp_on();
debug(DBG_INFO, "radsecproxy revision %s starting", PACKAGE_VERSION);
+ if (!pidfile)
+ pidfile = options.pidfile;
if (pidfile && !createpidfile(pidfile))
debugx(1, DBG_ERR, "failed to create pidfile %s: %s", pidfile, strerror(errno));