(RADIATOR) Patch: LogIdent for <AuthLog SYSLOG>

Mike McCauley mikem at open.com.au
Wed Oct 6 17:53:33 CDT 2004


Hello Heikki,

thanks for your patch.
It has been added for the next release, and is also on the latest 3.9 patch 
set.

Thanks again.

Cheers.

On Thursday 07 October 2004 02:29, Heikki Vatiainen wrote:
> One of our customers had problems with <Log SYSLOG>'s LogIdent parameter
> not working as expected. This seems to be fixed with the latest patch
> set since openlog() is now called before each syslog message. Previously
> openlog() was only called once during the constructor and subsequent
> openlog() call by AuthLogSYSLOG.pm did overwrite LogIdent with the
> Radiator executable name ($0 in Perl). While investigating the problem I
> came up with this additional patch.
>
> The attached patch adds optional LogIdent parameter for the <AuthLog
> SYSLOG> clause making its configuration options more similar to what
> <Log SYSLOG> has. The patch is against the current Radiator patches.
>
> If LogIdent is not specified in the configuration under AuthLog SYSLOG
> clause, the existing behavior is not changed. If it is present, it will
> replace the Radiator executable name as the syslog ident (the string
> prepended to all syslog messages).
>
> Looks like the text in section "6.11.5 LogIdent" is directly applicable
> for the manual entry of <AuthLog SYSLOG>.
>
> Please consider this simple patch for Radiator patches. Whitspace is
> probably messed up, but the attachment should have the tabs intact.
>
> --- Radius/AuthLogSYSLOG.pm.orig        2004-08-28 02:11:11.000000000 +0300
> +++ Radius/AuthLogSYSLOG.pm     2004-10-06 13:59:17.000000000 +0300
> @@ -22,6 +22,7 @@
>         'Priority'      => 'string',
>         'SuccessFormat' => 'string',
>         'FailureFormat' => 'string',
> +     'LogIdent'      => 'string',
>         );
>
>    #####################################################################
> @@ -56,6 +57,7 @@
>        $self->{SuccessFormat} = '%l:%U:%P:OK';
>        $self->{FailureFormat} = '%l:%U:%P:FAIL';
>        $self->{LogSock} = 'unix';
> +    $self->{LogIdent} = $0;
>    }
>
>    #####################################################################
> @@ -100,7 +102,7 @@
>
>        # syslog can die:
>        $str =~ s/%/%%/g; # Make sure to escape any % signs that would be
> interpreted as printf
> -    eval {openlog($0, 'pid', $self->{Facility});
> +    eval {openlog($self->{LogIdent}, 'pid', $self->{Facility});
>             syslog("$self->{Facility}|$self->{Priority}", $str);
>              closelog()};
>        &main::log($main::LOG_ERR, "Error while doing AuthLog SYSLOG: $@")
>
>
>
> Thanks,

-- 
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