(RADIATOR) Patch: LogIdent for <AuthLog SYSLOG>

Heikki Vatiainen hvn at archred.com
Wed Oct 6 11:29:14 CDT 2004


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,
-- 
Heikki Vatiainen
Arch Red Oy, Tampere, Finland


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: authlogsyslog.patch
URL: <http://www.open.com.au/pipermail/radiator/attachments/20041006/f59e29de/attachment.ksh>


More information about the radiator mailing list