bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Feature Request re: syslog and bashhist


From: Arthur200000
Subject: RE: Feature Request re: syslog and bashhist
Date: Tue, 11 Aug 2015 00:21:57 +0800 (CST)

You can add `-DSYSLOG_HISTORY` to your CFLAGS for building.

And for formatting, apply this patch:
--- bashhist.c 2015-08-11 00:09:38.449468800 +0800
+++ bashhist.c  2015-08-11 00:09:42.970623400 +0800
@@ -713,12 +713,12 @@
   char trunc[SYSLOG_MAXLEN];

   if (strlen(line) < SYSLOG_MAXLEN)
-    syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: PID=%d UID=%d %s", 
getpid(), current_user.uid, line);
+    syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "bash[%d]: UID=%d %s", getpid(), 
current_user.uid, line);
   else
     {
       strncpy (trunc, line, SYSLOG_MAXLEN);
       trunc[SYSLOG_MAXLEN - 1] = '\0';
-      syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY (TRUNCATED): PID=%d 
UID=%d %s", getpid(), current_user.uid, trunc);
+      syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "bash[%d] (TRUNCATED): UID=%d %s", 
getpid(), current_user.uid, trunc);
     }
 }
 #endif

I'm not quite familiar with those configure.ac magic, and therefore I can't 
write some AC_ARG_ENABLE for you.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]