diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-06-17 10:05:01 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-06-17 10:14:48 -0700 |
commit | 6d5107b8266f06e6fdf6daf2ffc8191dbe171466 (patch) | |
tree | fd6833daf73acbab4dfd0e1d106099d33946d522 /eval.c | |
parent | 17e6dd57b0b329888f64491a0bfdd0c9793dd216 (diff) | |
download | vyatta-bash-6d5107b8266f06e6fdf6daf2ffc8191dbe171466.tar.gz vyatta-bash-6d5107b8266f06e6fdf6daf2ffc8191dbe171466.zip |
Remove AUDIT_SHELL option
The concept of logging shell commands through audit subsystem
is not useful because it is too hard to configure, requires special
privledges, doesn't handle background commands, and is missing the
necessary information...
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 56 |
1 files changed, 2 insertions, 54 deletions
@@ -45,12 +45,6 @@ # include "bashhist.h" #endif -#if defined (AUDIT_SHELL) -# include "filecntl.h" -# include <libaudit.h> -# include <errno.h> -#endif - extern int EOF_reached; extern int indirection_level; extern int posixly_correct; @@ -68,51 +62,13 @@ extern char *current_readline_line; extern int current_readline_line_index; #endif -#if defined (AUDIT_SHELL) -static int audit_fd = -1; -static char *audit_tty; - -static int -audit_start () -{ - if (audit_fd < 0) - { - audit_fd = audit_open (); - if (audit_fd < 0) - { - if (errno != EINVAL && errno != EPROTONOSUPPORT - && errno != EAFNOSUPPORT) - return -1; - } - else - SET_CLOSE_ON_EXEC(audit_fd); - } - - if (audit_tty == NULL) - { - char *tty = ttyname(fileno(stdin)); - if (tty) - audit_tty = strdup(tty); - } - - return 0; -} - -static void -audit (result) - int result; -{ - audit_log_user_command (audit_fd, AUDIT_USER_CMD, current_readline_line, - audit_tty, result == EXECUTION_SUCCESS); -} -#endif /* Read and execute commands until EOF is reached. This assumes that the input source has already been initialized. */ int reader_loop () { - int our_indirection_level, result; + int our_indirection_level; COMMAND * volatile current_command; current_command = (COMMAND *)NULL; @@ -120,11 +76,6 @@ reader_loop () our_indirection_level = ++indirection_level; -#if defined (AUDIT_SHELL) - if (audited && interactive_shell && audit_start () < 0) - return EXECUTION_FAILURE; -#endif - while (EOF_Reached == 0) { int code; @@ -200,10 +151,7 @@ reader_loop () executing = 1; stdin_redir = 0; - result = execute_command (current_command); -#if defined (AUDIT_SHELL) - audit (result); -#endif + execute_command (current_command); exec_done: QUIT; |