summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-06-17 10:05:01 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-06-17 10:14:48 -0700
commit6d5107b8266f06e6fdf6daf2ffc8191dbe171466 (patch)
treefd6833daf73acbab4dfd0e1d106099d33946d522 /eval.c
parent17e6dd57b0b329888f64491a0bfdd0c9793dd216 (diff)
downloadvyatta-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.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/eval.c b/eval.c
index 8c8d39c..293d177 100644
--- a/eval.c
+++ b/eval.c
@@ -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;