Changeset 3233 for trunk


Ignore:
Timestamp:
Apr 30, 2007, 1:04:30 AM (18 years ago)
Author:
bird
Message:

Applied bash-3.1-bash-logger.patch (gentoo)

Location:
trunk/essentials/app-shells/bash
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/essentials/app-shells/bash/bashhist.c

    r3231 r3233  
    706706  hist_last_line_added = 1;
    707707  hist_last_line_pushed = 0;
    708   add_history (line);
     708  add_history (line, 1);
    709709  history_lines_this_session++;
    710710}
  • trunk/essentials/app-shells/bash/lib/readline/histexpand.c

    r3231 r3233  
    12231223  if (only_printing)
    12241224    {
    1225 #if 0
    1226       add_history (result);
    1227 #endif
     1225      add_history (result, 1);
    12281226      return (2);
    12291227    }
  • trunk/essentials/app-shells/bash/lib/readline/histfile.c

    r3231 r3233  
    263263            if (HIST_TIMESTAMP_START(line_start) == 0)
    264264              {
    265                 add_history (line_start);
     265                add_history (line_start,0);
    266266                if (last_ts)
    267267                  {
  • trunk/essentials/app-shells/bash/lib/readline/history.c

    r3231 r3233  
    3131
    3232#include <stdio.h>
     33
     34#include <syslog.h>
    3335
    3436#if defined (HAVE_STDLIB_H)
     
    247249   is  set to NULL. */
    248250void
    249 add_history (string)
     251add_history (string, logme)
    250252     const char *string;
     253     int logme; /* 0 means no sending history to syslog */
    251254{
    252255  HIST_ENTRY *temp;
     256  if (logme) {
     257    if (strlen(string)<600) {
     258      syslog(LOG_LOCAL5 | LOG_INFO, "HISTORY: PID=%d UID=%d %s",
     259        getpid(), getuid(), string);
     260    }
     261    else {
     262      char trunc[600];
     263      strncpy(trunc,string,sizeof(trunc));
     264      trunc[sizeof(trunc)-1]='\0';
     265      syslog(LOG_LOCAL5 | LOG_INFO, "HISTORY: PID=%d UID=%d %s(++TRUNC)",
     266          getpid(), getuid(), trunc);
     267    }
     268  }
    253269
    254270  if (history_stifled && (history_length == history_max_entries))
  • trunk/essentials/app-shells/bash/lib/readline/history.h

    r3231 r3233  
    8181/* Place STRING at the end of the history list.
    8282   The associated data field (if any) is set to NULL. */
    83 extern void add_history PARAMS((const char *));
     83extern void add_history PARAMS((const char *, int ));
    8484
    8585/* Change the timestamp associated with the most recent history entry to
Note: See TracChangeset for help on using the changeset viewer.