(RADIATOR) Patch: Allow AuthLog SYSLOG and Log SYSLOG use different facilities

Mike McCauley mikem at open.com.au
Tue May 18 18:41:38 CDT 2004


Hello Heikki,

thanks for sending this patch. We have rolled it in for the next release, and 
also included it in the current 3.9 patch set.

Thank you again.

Cheers.

On Wed, 19 May 2004 04:53 am, Heikki Vatiainen wrote:
> Currently Radiator supports logging authentication success and failure
> events and other messages via syslog. What we tried to do was to configure
> different facilities for both types of messages. Our configuration was
> similar to this:
>
> <Log SYSLOG>
>     Facility local2
>     Trace 4
> </Log>
> <AuthLog SYSLOG>
>     Facility local1
>     LogSuccess 1
>     LogFailure 1
> </AuthLog>
>
> What happened was that all the messages were logged with syslog facility
> local1. If the order of the blocks was reversed, all messages were still
> logged but this time with facility local2.
>
> A quick look showed that when the configuration is read, openlog() is
> called for both blocks and the block that is the last to use logging via
> syslog determines which facility is used for all messages that are sent
> to syslog.
>
> The patch below explicitly sets the facility every time a message is
> logged and makes it possible to separate authentication messages from
> the rest of the messages.
>
> Please consider this patch for the future versions of Radiator.
>
> This changes the existing behaviour in the case that someone is using
> the Facility keyword only once and both Log and AuthLog configuration
> blocks are specified. In this case the block that does not specify the
> facility will use the default which is 'user'.
>
>
>
> --- 3.9_2004-05-11.orig/Radius/AuthLogSYSLOG.pm	2003-08-01
> 04:42:28.000000000 +0300 +++
> 3.9_2004-05-11.archred.log.facility/Radius/AuthLogSYSLOG.pm	2004-05-17
> 23:36:58.000000000 +0300 @@ -100,7 +100,7 @@
>      }
>
>      # syslog can die:
> -    eval {syslog($self->{Priority}, $str)};
> +    eval {syslog("$self->{Facility}|$self->{Priority}", $str)};
>      &main::log($main::LOG_ERR, "Error while doing AuthLog SYSLOG: $@")
>  	if $@;
>  }
> --- 3.9_2004-05-11.orig/Radius/LogSYSLOG.pm	2003-09-23 02:31:33.000000000
> +0300 +++
> 3.9_2004-05-11.archred.log.facility/Radius/LogSYSLOG.pm	2004-05-17
> 23:46:57.000000000 +0300 @@ -68,7 +68,7 @@
>
>      if ($self->willLog($priority, $p))
>      {
> -	eval {syslog($priorityToSyslog[$priority], $s)};
> +	eval {syslog("$self->{Facility}|$priorityToSyslog[$priority]", $s)};
>  	&main::log($main::LOG_ERR, "Error while doing Log SYSLOG: $@")
>  	    if $@;
>      }

-- 
Mike McCauley                               mikem at open.com.au
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
9 Bulbul Place Currumbin Waters QLD 4223 Australia   http://www.open.com.au
Phone +61 7 5598-7474                       Fax   +61 7 5598-7070

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, 
TTLS, PEAP etc on Unix, Windows, MacOS etc.

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list