summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorkleink <kleink@NetBSD.org>2005-09-06 21:36:54 +0000
committerkleink <kleink@NetBSD.org>2005-09-06 21:36:54 +0000
commit6fa3ab87b7547e893d57f42c9ca81ba61bdb00fe (patch)
tree0e4b35348f5ef22b642d4fcc0caa00b23ea9a97d /sys/dev
parent3065f3379caa8fc4aebcfa66f8c3e334f213c9bf (diff)
Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of privileges. Noted by David Holland in PR kern/31126. Also, dispose of a redundant (and unreachable) instance of that check.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/clmpcc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/ic/clmpcc.c b/sys/dev/ic/clmpcc.c
index f00344a20f1..25612dede39 100644
--- a/sys/dev/ic/clmpcc.c
+++ b/sys/dev/ic/clmpcc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: clmpcc.c,v 1.24 2005/02/27 00:27:01 perry Exp $ */
+/* $NetBSD: clmpcc.c,v 1.25 2005/09/06 21:36:54 kleink Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.24 2005/02/27 00:27:01 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.25 2005/09/06 21:36:54 kleink Exp $");
#include "opt_ddb.h"
@@ -527,7 +527,8 @@ clmpccopen(dev, flag, mode, p)
tp = ch->ch_tty;
if ( ISSET(tp->t_state, TS_ISOPEN) &&
- ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0 )
+ ISSET(tp->t_state, TS_XCLUDE) &&
+ suser(p->p_ucred, &p->p_acflag) != 0 )
return EBUSY;
/*
@@ -587,9 +588,7 @@ clmpccopen(dev, flag, mode, p)
clmpcc_modem_control(ch, TIOCM_RTS | TIOCM_DTR, DMBIS);
clmpcc_select_channel(sc, oldch);
- } else
- if ( ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0 )
- return EBUSY;
+ }
error = ttyopen(tp, CLMPCCDIALOUT(dev), ISSET(flag, O_NONBLOCK));
if (error)