summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-24 22:13:10 +0000
committerMike Frysinger <vapier@gentoo.org>2009-02-24 22:13:10 +0000
commit615510d9cc4de6cd1d5ea5ba0aa7fe7b87521997 (patch)
tree4c492ce69bafebeefe712a37b90e14c275a00512 /app-shells
parentGnome-desktop-sharp and gnome-panel-sharp should depend on gte, not eq their ... (diff)
downloadgentoo-2-615510d9cc4de6cd1d5ea5ba0aa7fe7b87521997.tar.gz
gentoo-2-615510d9cc4de6cd1d5ea5ba0aa7fe7b87521997.tar.bz2
gentoo-2-615510d9cc4de6cd1d5ea5ba0aa7fe7b87521997.zip
touch up style a bit
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/bash/files/bash-3.1-bash-logger.patch19
1 files changed, 9 insertions, 10 deletions
diff --git a/app-shells/bash/files/bash-3.1-bash-logger.patch b/app-shells/bash/files/bash-3.1-bash-logger.patch
index 3bc29daf7552..4f6df31c455a 100644
--- a/app-shells/bash/files/bash-3.1-bash-logger.patch
+++ b/app-shells/bash/files/bash-3.1-bash-logger.patch
@@ -1,7 +1,7 @@
Add support for logging bash commands via syslog().
Useful for deploying in honeypot environments.
-http://bugs.gentoo.org/show_bug.cgi?id=91327
+http://bugs.gentoo.org/91327
http://www.nardware.co.uk/Security/html/bashlogger.htm
--- bashhist.c
@@ -35,7 +35,7 @@ http://www.nardware.co.uk/Security/html/bashlogger.htm
if (HIST_TIMESTAMP_START(line_start) == 0)
{
- add_history (line_start);
-+ add_history (line_start,0);
++ add_history (line_start, 0);
if (last_ts)
{
add_history_time (last_ts);
@@ -50,7 +50,7 @@ http://www.nardware.co.uk/Security/html/bashlogger.htm
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
#else
-@@ -246,10 +250,24 @@
+@@ -246,10 +250,23 @@
/* Place STRING at the end of the history list. The data field
is set to NULL. */
void
@@ -62,16 +62,15 @@ http://www.nardware.co.uk/Security/html/bashlogger.htm
{
HIST_ENTRY *temp;
+ if (logme) {
-+ if (strlen(string)<600) {
++ char trunc[600]; /* arbitrary max size of 600 bytes */
++ if (strlen(string) < sizeof(trunc)) {
+ 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';
++ } else {
++ memcpy(trunc, string, sizeof(trunc));
++ trunc[sizeof(trunc) - 1] = '\0';
+ syslog(LOG_LOCAL5 | LOG_INFO, "HISTORY: PID=%d UID=%d %s(++TRUNC)",
-+ getpid(), getuid(), trunc);
++ getpid(), getuid(), trunc);
+ }
+ }