summaryrefslogtreecommitdiff
path: root/sys/dev/hpc
diff options
context:
space:
mode:
authorkleink <kleink@NetBSD.org>2005-09-06 21:40:37 +0000
committerkleink <kleink@NetBSD.org>2005-09-06 21:40:37 +0000
commitaece7a90fd0f2feeb714e83a20e24f2206a1a45b (patch)
tree041b2a528dba9b81ece12e303295c1d444de74eb /sys/dev/hpc
parent6fa3ab87b7547e893d57f42c9ca81ba61bdb00fe (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.
Diffstat (limited to 'sys/dev/hpc')
-rw-r--r--sys/dev/hpc/biconsdev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/hpc/biconsdev.c b/sys/dev/hpc/biconsdev.c
index e70662da1af..afaec29834a 100644
--- a/sys/dev/hpc/biconsdev.c
+++ b/sys/dev/hpc/biconsdev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: biconsdev.c,v 1.10 2003/08/07 16:30:57 agc Exp $ */
+/* $NetBSD: biconsdev.c,v 1.11 2005/09/06 21:40:39 kleink Exp $ */
/*-
* Copyright (c) 1999-2001
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: biconsdev.c,v 1.10 2003/08/07 16:30:57 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: biconsdev.c,v 1.11 2005/09/06 21:40:39 kleink Exp $");
#include "biconsdev.h"
#include <sys/param.h>
@@ -181,7 +181,8 @@ biconsdevopen(dev_t dev, int flag, int mode, struct proc *p)
tp->t_state = TS_ISOPEN | TS_CARR_ON;
(void)(*tp->t_param)(tp, &tp->t_termios);
ttsetwater(tp);
- } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
+ } else if (tp->t_state & TS_XCLUDE &&
+ suser(p->p_ucred, &p->p_acflag) != 0)
return (EBUSY);
status = (*tp->t_linesw->l_open)(dev, tp);