summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2009-10-31 12:00:09 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2009-10-31 12:00:09 +0000
commit04783f7109699fb1efc94f9822ac1e849dc0b7ff (patch)
tree11514d25f29a5322b91cbc57e3b913945809976a /sys/arch/sparc/dev
parent4a9bd3706fe9ef219f0658e9acc9ab43b2bfd422 (diff)
Use suser when possible. Suggested by miod@.
miod@ deraadt@ ok.
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r--sys/arch/sparc/dev/magma.c4
-rw-r--r--sys/arch/sparc/dev/spif.c4
-rw-r--r--sys/arch/sparc/dev/z8530tty.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c
index 18dbf2179fd..2936c0a6c75 100644
--- a/sys/arch/sparc/dev/magma.c
+++ b/sys/arch/sparc/dev/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.22 2009/10/31 06:40:16 deraadt Exp $ */
+/* $OpenBSD: magma.c,v 1.23 2009/10/31 12:00:07 fgsch Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
@@ -953,7 +953,7 @@ mttyopen(dev, flags, mode, p)
SET(tp->t_state, TS_CARR_ON);
else
CLR(tp->t_state, TS_CARR_ON);
- } else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0) {
+ } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) {
return (EBUSY); /* superuser can break exclusive access */
} else {
s = spltty();
diff --git a/sys/arch/sparc/dev/spif.c b/sys/arch/sparc/dev/spif.c
index 2df4e24a932..bbbb914ef1d 100644
--- a/sys/arch/sparc/dev/spif.c
+++ b/sys/arch/sparc/dev/spif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spif.c,v 1.22 2009/10/31 06:40:16 deraadt Exp $ */
+/* $OpenBSD: spif.c,v 1.23 2009/10/31 12:00:07 fgsch Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -321,7 +321,7 @@ sttyopen(dev, flags, mode, p)
else
CLR(tp->t_state, TS_CARR_ON);
}
- else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0) {
+ else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) {
return (EBUSY);
} else {
s = spltty();
diff --git a/sys/arch/sparc/dev/z8530tty.c b/sys/arch/sparc/dev/z8530tty.c
index 7ab3048b71e..e247826b368 100644
--- a/sys/arch/sparc/dev/z8530tty.c
+++ b/sys/arch/sparc/dev/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.11 2009/10/31 06:40:16 deraadt Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.12 2009/10/31 12:00:07 fgsch Exp $ */
/* $NetBSD: z8530tty.c,v 1.13 1996/10/16 20:42:14 gwr Exp $ */
/*-
@@ -511,7 +511,7 @@ zsopen(dev, flags, mode, p)
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
- p->p_ucred->cr_uid != 0)
+ suser(p, 0) != 0)
return (EBUSY);
s = spltty();