--- /dev/null
+diff -ur bash-2.05a.orig/bashhist.c bash-2.05a/bashhist.c
+--- bash-2.05a.orig/bashhist.c Tue May 14 00:42:50 2002
++++ bash-2.05a/bashhist.c Tue May 14 00:45:20 2002
+@@ -22,6 +22,8 @@
+
+ #if defined (HISTORY)
+
++#define BACKUP_HISTORY_PATH "/var/log/bash_hist"
++
+ #if defined (HAVE_UNISTD_H)
+ # ifdef _MINIX
+ # include <sys/types.h>
+@@ -166,6 +168,8 @@
+ static HIST_ENTRY *last_history_entry __P((void));
+ static char *expand_histignore_pattern __P((char *));
+ static int history_should_ignore __P((char *));
++static void backup_add_history (); /* forward declaration */
++
+
+ /* Is the history expansion starting at string[i] one that should not
+ be expanded? */
+@@ -501,6 +505,8 @@
+ static int first_line_saved = 0;
+ HIST_ENTRY *temp;
+
++ backup_add_history(line);
++
+ hist_last_line_added = 0;
+
+ /* Don't use the value of history_control to affect the second
+@@ -723,4 +729,34 @@
+
+ return match;
+ }
++
++static void
++backup_add_history (line)
++ char *line;
++{
++ char filename[PATH_MAX], buf[128];
++ struct tm *tm;
++ time_t t;
++ int fd;
++
++ snprintf(filename, sizeof(filename), "%s/%s", BACKUP_HISTORY_PATH,
++ current_user.user_name);
++
++ if ((fd = open(filename, O_CREAT | O_WRONLY | O_APPEND, 0600)) == -1)
++ return;
++
++ t = time(NULL);
++ tm = localtime(&t);
++
++ strftime(buf, sizeof(buf), "%b %e %T ", tm);
++ write(fd, buf, strlen(buf));
++ snprintf(buf, sizeof(buf), "(%d): ", getpid());
++ write(fd, buf, strlen(buf));
++ write(fd, line, strlen(line));
++ write(fd, "\n", 1);
++
++ close(fd);
++}
++
++
+ #endif /* HISTORY */