Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 57941 Details for
Bug 91327
Bash Syslog patch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bash-2.05b patch
bash-2.05b-syslog.patch-2 (text/plain), 4.58 KB, created by
Kevin Landreth
on 2005-05-03 09:43:06 UTC
(
hide
)
Description:
bash-2.05b patch
Filename:
MIME Type:
Creator:
Kevin Landreth
Created:
2005-05-03 09:43:06 UTC
Size:
4.58 KB
patch
obsolete
>diff -urN ./Makefile.in ../bash-2.05b-syslog/Makefile.in >--- ./Makefile.in 2005-05-03 10:53:26.286177782 -0500 >+++ ../bash-2.05b-syslog/Makefile.in 2005-05-03 09:53:47.805549183 -0500 >@@ -612,7 +612,6 @@ > > # comment out for distribution > $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in > $(srcdir) && autoconf > > # for chet > reconfig: force >diff -urN ./bashhist.c ../bash-2.05b-syslog/bashhist.c >--- ./bashhist.c 2002-03-12 09:29:56.000000000 -0600 >+++ ../bash-2.05b-syslog/bashhist.c 2005-05-03 09:45:56.588502285 -0500 >@@ -654,7 +654,11 @@ > char *line; > { > hist_last_line_added = 1; >+# ifdef USE_SYSLOG >+ add_history (line, 1); >+# else > add_history (line); >+# endif > history_lines_this_session++; > } > >diff -urN ./configure.in ../bash-2.05b-syslog/configure.in >--- ./configure.in 2002-07-16 08:31:25.000000000 -0500 >+++ ../bash-2.05b-syslog/configure.in 2005-05-03 10:57:27.756964445 -0500 >@@ -55,6 +55,7 @@ > opt_afs=no > opt_curses=no > opt_with_installed_readline=no >+opt_syslog=no > > #htmldir= > >@@ -101,6 +102,11 @@ > AC_ARG_WITH(installed-readline, AC_HELP_STRING([--with-installed-readline], [use a version of the readline library that is already installed]), opt_with_installed_readline=$withval) > AC_ARG_WITH(purecov, AC_HELP_STRING([--with-purecov], [configure to postprocess with pure coverage]), opt_purecov=$withval) > AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) >+AC_ARG_WITH(syslog, AC_HELP_STRING([--with-syslog], [additional logging via syslog]), opt_syslog=$withval) >+ >+if test "$opt_syslog" = yes; then >+ AC_DEFINE(USE_SYSLOG) >+fi > > if test "$opt_bash_malloc" = yes; then > MALLOC_TARGET=malloc >diff -urN ./lib/readline/histexpand.c ../bash-2.05b-syslog/lib/readline/histexpand.c >--- ./lib/readline/histexpand.c 2002-04-16 10:47:59.000000000 -0500 >+++ ../bash-2.05b-syslog/lib/readline/histexpand.c 2005-05-03 09:44:47.568444811 -0500 >@@ -1160,7 +1160,11 @@ > > if (only_printing) > { >- add_history (result); >+#ifdef USE_SYSLOG >+ add_history (result, 1); /* Ant: new 2nd argument means do syslog */ >+#else >+ add_history (result); /* orig */ >+#endif > return (2); > } > >diff -urN ./lib/readline/histfile.c ../bash-2.05b-syslog/lib/readline/histfile.c >--- ./lib/readline/histfile.c 2002-03-26 08:00:26.000000000 -0600 >+++ ../bash-2.05b-syslog/lib/readline/histfile.c 2005-05-03 09:44:37.490219929 -0500 >@@ -231,7 +231,11 @@ > *line_end = '\0'; > > if (*line_start) >- add_history (line_start); >+#ifdef USE_SYSLOG >+ add_history (line_start,0); /* Ant: new 2nd arg means skip syslog */ >+#else >+ add_history (line_start); /* orig */ >+#endif > > current_line++; > >diff -urN ./lib/readline/history.c ../bash-2.05b-syslog/lib/readline/history.c >--- ./lib/readline/history.c 2002-03-12 10:27:34.000000000 -0600 >+++ ../bash-2.05b-syslog/lib/readline/history.c 2005-05-03 09:49:35.692470548 -0500 >@@ -31,6 +31,10 @@ > > #include <stdio.h> > >+#ifdef USE_SYSLOG >+# include <syslog.h> >+#endif >+ > #if defined (HAVE_STDLIB_H) > # include <stdlib.h> > #else >@@ -209,10 +213,31 @@ > /* Place STRING at the end of the history list. The data field > is set to NULL. */ > void >+#ifdef USE_SYSLOG >+add_history (string, logme) >+ const char *string; >+ int logme; /* 0 means no sending history to syslog */ >+#else > add_history (string) > const char *string; >+#endif > { > HIST_ENTRY *temp; >+#ifdef USE_SYSLOG >+ if (logme) { >+ if (strlen(string)<600) { >+ syslog(LOG_LOCAL5 | LOG_INFO, "HISTORY: PID=%d UID=%d %s", >+ getpid(), getuid(), string); >+ } >+ else { >+ char trunc[600]; >+ strncpy(trunc,string,sizeof(trunc)); >+ trunc[sizeof(trunc)-1]='\0'; >+ syslog(LOG_LOCAL5, LOG_INFO, "HISTORY: PID=%d UID=%d %s(++TRUNC)", >+ getpid(), getuid(), trunc); >+ } >+ } >+#endif > > if (history_stifled && (history_length == history_max_entries)) > { >diff -urN ./lib/readline/history.h ../bash-2.05b-syslog/lib/readline/history.h >--- ./lib/readline/history.h 2001-08-22 08:37:23.000000000 -0500 >+++ ../bash-2.05b-syslog/lib/readline/history.h 2005-05-03 09:46:36.804419073 -0500 >@@ -74,7 +74,11 @@ > > /* 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 *)); >+#ifdef USE_SYSLOG /* kev added config time */ >+extern void add_history PARAMS((const char *, int )); /* Ant added arg */ >+#else >+extern void add_history PARAMS((const char *)); >+#endif > > /* A reasonably useless function, only here for completeness. WHICH > is the magic number that tells us which element to delete. The
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 91327
: 57941 |
57967
|
91498