diff options
| author | Maja Gorecka-Wolniewicz <mgw@puma.uci.umk.pl> | 2011-12-12 12:43:24 +0100 | 
|---|---|---|
| committer | Maja Gorecka-Wolniewicz <mgw@puma.uci.umk.pl> | 2011-12-12 12:43:24 +0100 | 
| commit | ac5c1024b9027a76e176169d2f2a5c73514a7710 (patch) | |
| tree | 8bcdd4dcb3b7d7488f6538b8802ff31d5345e572 | |
| parent | e41e5198e5b93a21c0997fd9f7e9ed7f28b8aea0 (diff) | |
formatting and skipping openlog call for FTOCKS_LOG
| -rw-r--r-- | debug.c | 15 | ||||
| -rw-r--r-- | radsecproxy.c | 14 | 
2 files changed, 15 insertions, 14 deletions
| @@ -104,22 +104,21 @@ int debug_set_destination(char *dest, int log_type) {  		    break;  	    if (!facstrings[i])  		debugx(1, DBG_ERR, "Unknown syslog facility %s", dest); +#if defined(WANT_FTICKS)  	    if (log_type==FTICKS_LOG)  		fticks_syslogfacility = facvals[i]; -	    else +#endif +	    if (log_type!=FTICKS_LOG)  		debug_syslogfacility = facvals[i];  	} else { +#if defined(WANT_FTICKS)  		if (log_type==FTICKS_LOG)  		   fticks_syslogfacility = 0; -		else +#endif +		if (log_type!=FTICKS_LOG)  	    	   debug_syslogfacility = LOG_DAEMON;      	} -	if (log_type==FTICKS_LOG) { -		if (fticks_syslogfacility && !debug_syslogfacility) { -		    openlog(debug_ident, LOG_PID, fticks_syslogfacility); -		} -	} else  -		openlog(debug_ident, LOG_PID, debug_syslogfacility); +	openlog(debug_ident, LOG_PID, debug_syslogfacility);  	return 1;      }      debug(DBG_ERR, "Unknown log destination, exiting %s", dest); diff --git a/radsecproxy.c b/radsecproxy.c index 426b65b..e780b96 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1668,7 +1668,7 @@ void replyh(struct server *server, unsigned char *buf) {      }  #if defined(WANT_FTICKS) -    if (msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject)  +    if (msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject)  	if (options.fticks_reporting && from->conf->fticks_viscountry != NULL)  	    fticks_log(&options, from, msg, rqout);  #endif @@ -3082,7 +3082,7 @@ void getmainconfig(const char *configfile) {  #endif  	    "Rewrite", CONF_CBK, confrewrite_cb, NULL,  #if defined(WANT_FTICKS) -	    "FTicksSyslogFacility", CONF_STR, &options.ftickssyslogfacility,  +	    "FTicksSyslogFacility", CONF_STR, &options.ftickssyslogfacility,  	    "FTicksReporting", CONF_STR, &fticks_reporting_str,  	    "FTicksMAC", CONF_STR, &fticks_mac_str,  	    "FTicksKey", CONF_STR, &fticks_key_str, @@ -3241,12 +3241,14 @@ int radsecproxy_main(int argc, char **argv) {      else if (options.loglevel)  	debug_set_level(options.loglevel);      if (!foreground) { -	debug_set_destination(options.logdestination ? options.logdestination : "x-syslog:///", DEBUG_LOG); +	debug_set_destination(options.logdestination +                              ? options.logdestination +                              : "x-syslog:///", DEBUG_LOG);  #if defined(WANT_FTICKS)      	if (options.ftickssyslogfacility) { -		debug_set_destination(options.ftickssyslogfacility, FTICKS_LOG); -		free(options.ftickssyslogfacility); -    	}  +            debug_set_destination(options.ftickssyslogfacility, FTICKS_LOG); +            free(options.ftickssyslogfacility); +    	}  #endif      }      free(options.logdestination); | 
