Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
bash-syslog
> bash-3.2-syslog.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File bash-3.2-syslog.patch of Package bash-syslog
diff -crB bash-3.2/bashhist.c bash-3.2.new/bashhist.c *** bash-3.2/bashhist.c Sat Sep 25 00:50:44 2010 --- bash-3.2.new/bashhist.c Sat Sep 25 00:50:58 2010 *************** *** 708,714 **** { hist_last_line_added = 1; hist_last_line_pushed = 0; ! add_history (line); history_lines_this_session++; } --- 708,714 ---- { hist_last_line_added = 1; hist_last_line_pushed = 0; ! add_history (line, 1); history_lines_this_session++; } Only in bash-3.2.new/: bashhist.c.ORIG diff -crB bash-3.2/lib/readline/histexpand.c bash-3.2.new/lib/readline/histexpand.c *** bash-3.2/lib/readline/histexpand.c Sat Jul 29 16:44:17 2006 --- bash-3.2.new/lib/readline/histexpand.c Sat Sep 25 00:53:05 2010 *************** *** 1221,1227 **** if (only_printing) { #if 0 ! add_history (result); #endif return (2); } --- 1221,1227 ---- if (only_printing) { #if 0 ! add_history (result, 1); #endif return (2); } Only in bash-3.2.new/lib/readline: histexpand.c.ORIG diff -crB bash-3.2/lib/readline/histfile.c bash-3.2.new/lib/readline/histfile.c *** bash-3.2/lib/readline/histfile.c Fri Mar 31 15:48:43 2006 --- bash-3.2.new/lib/readline/histfile.c Sat Sep 25 00:53:38 2010 *************** *** 266,272 **** { if (HIST_TIMESTAMP_START(line_start) == 0) { ! add_history (line_start); if (last_ts) { add_history_time (last_ts); --- 266,272 ---- { if (HIST_TIMESTAMP_START(line_start) == 0) { ! add_history (line_start, 0); if (last_ts) { add_history_time (last_ts); Only in bash-3.2.new/lib/readline: histfile.c.ORIG diff -crB bash-3.2/lib/readline/history.c bash-3.2.new/lib/readline/history.c *** bash-3.2/lib/readline/history.c Sun May 21 13:39:41 2006 --- bash-3.2.new/lib/readline/history.c Sat Sep 25 00:55:36 2010 *************** *** 42,49 **** --- 42,52 ---- # include <sys/types.h> # endif # include <unistd.h> + #endif + #include <syslog.h> + #include "history.h" #include "histlib.h" *************** *** 262,272 **** /* Place STRING at the end of the history list. The data field is set to NULL. */ void ! add_history (string) ! const char *string; { HIST_ENTRY *temp; if (history_stifled && (history_length == history_max_entries)) { register int i; --- 265,289 ---- /* Place STRING at the end of the history list. The data field is set to NULL. */ void ! add_history (const char *string, int logme) { HIST_ENTRY *temp; + if (logme) { + if (strlen(string)<600) { + syslog(LOG_LOCAL5 | LOG_INFO, "history: [pid:%d user:%s] %s", + getpid(), getlogin(), string); + } else { + char trunc[600]; + + strncpy(trunc,string,sizeof(trunc)); + trunc[sizeof(trunc)-1]='\0'; + syslog(LOG_LOCAL5| LOG_INFO, "history: [pid:%d user:%s] %s(++TRUNC)", + getpid(), getlogin(), trunc); + } + } + + if (history_stifled && (history_length == history_max_entries)) { register int i; Only in bash-3.2.new/lib/readline: history.c.ORG diff -crB bash-3.2/lib/readline/history.h bash-3.2.new/lib/readline/history.h *** bash-3.2/lib/readline/history.h Thu Jul 31 08:38:44 2003 --- bash-3.2.new/lib/readline/history.h Sat Sep 25 00:56:18 2010 *************** *** 80,86 **** /* Place STRING at the end of the history list. The associated data field (if any) is set to NULL. */ ! extern void add_history PARAMS((const char *)); /* Change the timestamp associated with the most recent history entry to STRING. */ --- 80,86 ---- /* Place STRING at the end of the history list. The associated data field (if any) is set to NULL. */ ! extern void add_history PARAMS((const char *, int)); /* Change the timestamp associated with the most recent history entry to STRING. */ Only in bash-3.2.new/lib/readline: history.h.ORIG