aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@redhat.com>2008-04-18 16:30:14 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-04-28 06:28:24 -0400
commit41126226e186d92a45ed664e546abb5204588359 (patch)
treecd31de9587e81b01934fe95e574be109dd0129c7 /drivers/char/tty_io.c
parent7719e437fac119e57b17588bab3a8e39ff9d22eb (diff)
[patch 1/2] audit: let userspace fully control TTY input auditing
Remove the code that automatically disables TTY input auditing in processes that open TTYs when they have no other TTY open; this heuristic was intended to automatically handle daemons, but it has false positives (e.g. with sshd) that make it impossible to control TTY input auditing from a PAM module. With this patch, TTY input auditing is controlled from user-space only. On the other hand, not even for daemons does it make sense to audit "input" from PTY masters; this data was produced by a program writing to the PTY slave, and does not represent data entered by the user. Signed-off-by: Miloslav Trmac <mitr@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 4d3c7018f0c3..afddccf1bb3d 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2755,7 +2755,6 @@ got_driver:
2755 __proc_set_tty(current, tty); 2755 __proc_set_tty(current, tty);
2756 spin_unlock_irq(&current->sighand->siglock); 2756 spin_unlock_irq(&current->sighand->siglock);
2757 mutex_unlock(&tty_mutex); 2757 mutex_unlock(&tty_mutex);
2758 tty_audit_opening();
2759 return 0; 2758 return 0;
2760} 2759}
2761 2760
@@ -2818,10 +2817,8 @@ static int ptmx_open(struct inode *inode, struct file *filp)
2818 2817
2819 check_tty_count(tty, "tty_open"); 2818 check_tty_count(tty, "tty_open");
2820 retval = ptm_driver->open(tty, filp); 2819 retval = ptm_driver->open(tty, filp);
2821 if (!retval) { 2820 if (!retval)
2822 tty_audit_opening();
2823 return 0; 2821 return 0;
2824 }
2825out1: 2822out1:
2826 release_dev(filp); 2823 release_dev(filp);
2827 return retval; 2824 return retval;