Skip to content

Commit a8a18d5

Browse files
committed
Fix tacacs local accounting break. (sonic-net#18357)
Fix TACACS local accounting disabled when debug flag disabled. #### Why I did it TACACS local accounting use trace() method to output local accounting log, following PR disable trace log when debug flag disabled, sonic-net#16482 Because test case issue, this regression not found. the issue only exists on master branch. ### How I did it Fix TACACS local accounting disabled when debug flag disabled. #### How to verify it Pass all UT. Fix TACACS accounting UT to prevent regression. ### Tested branch (Please provide the tested image version) - [] SONiC.master-16482.360728-2c8b4066f #### Description for the changelog Fix TACACS local accounting disabled when debug flag disabled.
1 parent 80f07eb commit a8a18d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tacacs/audisp/patches/0003-Add-local-accounting.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ index 0000000..e23acec
7070
+#include "trace.h"
7171
+
7272
+/* Accounting log format. */
73-
+#define ACCOUNTING_LOG_FORMAT "Accounting: user: %s, tty: %s, host: %s, command: %s, type: %d, task ID: %d"
73+
+#define ACCOUNTING_LOG_FORMAT "Audisp-tacplus: Accounting: user: %s, tty: %s, host: %s, command: %s, type: %d, task ID: %d"
7474
+
7575
+/* Write the accounting information to syslog. */
7676
+void accounting_to_syslog(char *user, char *tty, char *host, char *cmdmsg, int type, uint16_t task_id)
7777
+{
78-
+ trace(ACCOUNTING_LOG_FORMAT, user, tty, host, cmdmsg, type, task_id);
78+
+ syslog(LOG_INFO, ACCOUNTING_LOG_FORMAT, user, tty, host, cmdmsg, type, task_id);
7979
+}
8080
\ No newline at end of file
8181
diff --git a/local_accounting.h b/local_accounting.h

0 commit comments

Comments
 (0)