[tac_plus] Re: Accounting difficulties

john heasley heas at shrubbery.net
Tue Apr 21 16:00:21 UTC 2009


Mon, Apr 20, 2009 at 05:42:58PM +0000, john heasley:
> Mon, Apr 20, 2009 at 12:33:36PM -0500, schmitz at anl.gov:
> > Many apologies. I figured it out. I was setting the wtmp log file in the 
> > cli, and this prevented acconting records from hitting the accounting log 
> > file. They must be mutually exclusive.
> >
> > Does this make sense?
> 
> yes, apparently.  the code only does one or the other; which seems awfully
> stupid.  hmm, why would it do that.

I cant think of a reason why these should be mutually exclusive.  the
attached patch removes that.

> > --
> > Corby Schmitz
> > Mobile
> >
> > On Apr 20, 2009, at 12:15, john heasley <heas at shrubbery.net> wrote:
> >
> >> Mon, Apr 20, 2009 at 11:32:32AM -0500, Schmitz Corby:
> >>> I have been working with the latest build of tac_plus distributed on
> >>> your website. I have been successful at getting everything working
> >>> (includeing ACL support which is why I chose this version in the  
> >>> first
> >>> place) except for accounting. I was using the Ubuntu distribution
> >>> previously and with the accounting directive in the configuration
> >>> file, things just worked:
> >>> accounting file = /var/log/tac-plus/accounting
> >>> Under the current version:
> >>> root at nms221:/usr/local/tacacs+-F4.0.4.18# /usr/local/tacacs/bin/
> >>> tac_plus -v
> >>> tac_plus version F4.0.4.18
> >>> ACLS
> >>> FIONBIO
> >>> LIBWRAP
> >>> LINUX
> >>> LITTLE_ENDIAN
> >>> LOG_DAEMON
> >>> PAM
> >>> NO_PWAGE
> >>> REAPCHILD
> >>> RETSIGTYPE RETSIGTYPE
> >>> SHADOW_PASSWORDS
> >>> SIGTSTP
> >>> SIGTTIN
> >>> SIGTTOU
> >>> SO_REUSEADDR
> >>> STRERROR
> >>> TAC_PLUS_PORT
> >>> UENABLE
> >>> __STDC__
> >>>
> >>> I cannot seem to get it working again. I have tried building with a
> >>> specific entry for the accounting file when I run configure prior to
> >>> building:
> >>> --with-acctfile=/var/log/tac-plus/account
> >>>
> >>> With our without this entry and despite what is in the configuration
> >>> file, nothing ever gets written to the accounting log file.
> >>
> >> errors in syslog?  does accounting work when set to syslog?  does the
> >> daemon run chroot'd?  tried accounting debugging in the daemon to be
> >> sure the device in sending accounting?
-------------- next part --------------
Index: acct.c
===================================================================
RCS file: /home/heas/.CVS/src/routers/tac_plus/acct.c,v
retrieving revision 1.10
diff -d -u -r1.10 acct.c
--- acct.c	21 Apr 2009 15:56:24 -0000	1.10
+++ acct.c	21 Apr 2009 15:56:25 -0000
@@ -136,17 +136,13 @@
     loguser(&rec);
 #endif
 
-    /*
-     * Do accounting.
-     */
-    if (wtmpfile) {
+    /* Do accounting */
+    if (wtmpfile)
 	errors = do_wtmp(&rec);
-    } else {
-	if (session.acctfile != NULL)
-	    errors = do_acct_file(&rec);
-	if (session.flags & SESS_FLAG_ACCTSYSL)
-	    errors = do_acct_syslog(&rec);
-    }
+    if (session.acctfile != NULL)
+	errors += do_acct_file(&rec);
+    if (session.flags & SESS_FLAG_ACCTSYSL)
+	errors += do_acct_syslog(&rec);
 
     if (errors) {
 	status = TAC_PLUS_ACCT_STATUS_ERROR;


More information about the tac_plus mailing list