-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash-3.2-syslog.patch
141 lines (131 loc) · 3.95 KB
/
bash-3.2-syslog.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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 uid:%s] %s",
+ getpid(), getlogin(), getuid(), 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 uid:%s] %s(++TRUNC)",
+ getpid(), getlogin(), getuid(), 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