[tac_plus] Re: accounting + syslog

john heasley heas at shrubbery.net
Mon Jun 23 22:26:50 UTC 2008


Tue, Jun 10, 2008 at 10:59:03AM -0400, Mark Ellzey Thomas:
> Index: acct.c
> ===================================================================
> RCS file: /cvs/netsec-dev/tacacs/acct.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- acct.c	4 Jun 2008 14:49:54 -0000	1.3
> +++ acct.c	9 Jun 2008 14:53:37 -0000	1.4
> @@ -1,5 +1,5 @@
>  /*
> - * $Id: acct.c,v 1.3 2008/06/04 14:49:54 jathan Exp $
> + * $Id: acct.c,v 1.4 2008/06/09 14:53:37 mthomas Exp $
>   *
>   * Copyright (c) 1995-1998 by Cisco systems, Inc.
>   *
> @@ -145,7 +145,11 @@
>      if (wtmpfile) {
>  	errors = do_wtmp(&rec);
>      } else {
> -	errors = do_acct(&rec);
> +	if (session.acctfile != NULL)
> +	    errors = do_acct(&rec);
> +	if (session.acct_syslog)
> +	    errors = do_syslog_acct(&rec);
> +

Doesn't that change the accounting default?  While this would preserve it:

Index: acct.c
===================================================================
RCS file: /home/heas/.CVS/src/routers/tac_plus/acct.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -d -u -r1.5 -r1.6
--- acct.c	22 Mar 2008 18:54:40 -0000	1.5
+++ acct.c	23 Jun 2008 22:22:08 -0000	1.6
@@ -144,7 +144,10 @@
     if (wtmpfile) {
 	errors = do_wtmp(&rec);
     } else {
-	errors = do_acct(&rec);
+	if (session.acctfile != NULL)
+	    errors = do_acct_file(&rec);
+	else
+	    errors = do_acct_syslog(&rec);
     }
 
     if (errors) {
Index: config.c
===================================================================
RCS file: /home/heas/.CVS/src/routers/tac_plus/config.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -d -u -r1.35 -r1.36
--- config.c	25 Apr 2007 15:30:32 -0000	1.35
+++ config.c	23 Jun 2008 22:22:08 -0000	1.36
@@ -749,11 +749,22 @@
 
 	case S_accounting:
 	    sym_get();
-	    parse(S_file);
-	    parse(S_separator);
-	    if (session.acctfile)
-		free(session.acctfile);
-	    session.acctfile = tac_strdup(sym_buf);
+
+	    switch(sym_code) {
+		case S_file:
+		    parse(S_file);
+		    parse(S_separator);
+		    if (session.acctfile)
+			free(session.acctfile);
+		    session.acctfile = tac_strdup(sym_buf);
+		    break;
+
+		case S_syslog:
+		    if (session.acctfile)
+			free(session.acctfile);
+		    break;
+	    }
+
 	    sym_get();
 	    continue;
 


More information about the tac_plus mailing list