summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-08-15 20:32:22 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-08-15 20:32:22 +0000
commita1ee01486d4d2da0dce2fd97a58ca548a402d598 (patch)
treeeb06f4625b973fc701bb62d6902e4f1eb40bb4f2 /sys/arch
parent1a3299929d48eae52404e0b75267c111d07d2af4 (diff)
change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/mem.c4
-rw-r--r--sys/arch/hp300/dev/apci.c4
-rw-r--r--sys/arch/hp300/dev/dca.c4
-rw-r--r--sys/arch/hp300/dev/dcm.c4
-rw-r--r--sys/arch/hp300/dev/sd.c4
-rw-r--r--sys/arch/i386/i386/linux_machdep.c6
-rw-r--r--sys/arch/i386/i386/mem.c6
-rw-r--r--sys/arch/i386/i386/sys_machdep.c6
-rw-r--r--sys/arch/i386/isa/pccom.c4
-rw-r--r--sys/arch/mac68k/dev/z8530tty.c10
-rw-r--r--sys/arch/macppc/dev/z8530tty.c4
-rw-r--r--sys/arch/macppc/macppc/mem.c4
-rw-r--r--sys/arch/mvme68k/dev/bugtty.c4
-rw-r--r--sys/arch/mvme68k/dev/cl.c4
-rw-r--r--sys/arch/mvme68k/dev/wl.c4
-rw-r--r--sys/arch/mvme88k/dev/bugtty.c4
-rw-r--r--sys/arch/mvme88k/dev/cl.c4
-rw-r--r--sys/arch/mvme88k/dev/dart.c4
-rw-r--r--sys/arch/mvme88k/dev/vx.c4
-rw-r--r--sys/arch/mvmeppc/dev/bugtty.c4
-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/xd.c4
-rw-r--r--sys/arch/sparc/dev/xy.c4
-rw-r--r--sys/arch/sparc/dev/z8530tty.c4
-rw-r--r--sys/arch/sparc64/dev/pcons.c4
-rw-r--r--sys/arch/sparc64/dev/sab.c6
-rw-r--r--sys/arch/sparc64/dev/z8530tty.c4
28 files changed, 63 insertions, 63 deletions
diff --git a/sys/arch/alpha/alpha/mem.c b/sys/arch/alpha/alpha/mem.c
index 09f4ff09984..d6976678229 100644
--- a/sys/arch/alpha/alpha/mem.c
+++ b/sys/arch/alpha/alpha/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.18 2003/06/02 23:27:43 millert Exp $ */
+/* $OpenBSD: mem.c,v 1.19 2003/08/15 20:32:12 tedu Exp $ */
/* $NetBSD: mem.c,v 1.26 2000/03/29 03:48:20 simonb Exp $ */
/*
@@ -82,7 +82,7 @@ mmopen(dev, flag, mode, p)
return (0);
#ifdef APERTURE
case 4:
- if (suser(p->p_ucred, &p->p_acflag) != 0 || !allowaperture)
+ if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() from the same pid */
diff --git a/sys/arch/hp300/dev/apci.c b/sys/arch/hp300/dev/apci.c
index 3d76088ae8f..312e589d1ab 100644
--- a/sys/arch/hp300/dev/apci.c
+++ b/sys/arch/hp300/dev/apci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apci.c,v 1.13 2003/06/04 22:08:12 deraadt Exp $ */
+/* $OpenBSD: apci.c,v 1.14 2003/08/15 20:32:12 tedu Exp $ */
/* $NetBSD: apci.c,v 1.9 2000/11/02 00:35:05 eeh Exp $ */
/*-
@@ -674,7 +674,7 @@ apciioctl(dev, cmd, data, flag, p)
case TIOCSFLAGS: {
int userbits;
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error)
return (EPERM);
diff --git a/sys/arch/hp300/dev/dca.c b/sys/arch/hp300/dev/dca.c
index 97c037d3fa3..922e427ecb1 100644
--- a/sys/arch/hp300/dev/dca.c
+++ b/sys/arch/hp300/dev/dca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dca.c,v 1.16 2003/06/02 23:27:44 millert Exp $ */
+/* $OpenBSD: dca.c,v 1.17 2003/08/15 20:32:12 tedu Exp $ */
/* $NetBSD: dca.c,v 1.35 1997/05/05 20:58:18 thorpej Exp $ */
/*
@@ -733,7 +733,7 @@ dcaioctl(dev, cmd, data, flag, p)
case TIOCSFLAGS: {
int userbits;
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error)
return (EPERM);
diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c
index a313ccbe432..5fe84ec323e 100644
--- a/sys/arch/hp300/dev/dcm.c
+++ b/sys/arch/hp300/dev/dcm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcm.c,v 1.14 2003/06/02 23:27:44 millert Exp $ */
+/* $OpenBSD: dcm.c,v 1.15 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: dcm.c,v 1.41 1997/05/05 20:59:16 thorpej Exp $ */
/*
@@ -1031,7 +1031,7 @@ dcmioctl(dev, cmd, data, flag, p)
case TIOCSFLAGS: {
int userbits;
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error)
return (EPERM);
diff --git a/sys/arch/hp300/dev/sd.c b/sys/arch/hp300/dev/sd.c
index 5a02b64aac5..c83ffda1e90 100644
--- a/sys/arch/hp300/dev/sd.c
+++ b/sys/arch/hp300/dev/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.30 2003/06/02 23:27:45 millert Exp $ */
+/* $OpenBSD: sd.c,v 1.31 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: sd.c,v 1.34 1997/07/10 18:14:10 kleink Exp $ */
/*
@@ -1109,7 +1109,7 @@ sdioctl(dev, cmd, data, flag, p)
case SDIOCSFORMAT:
/* take this device into or out of "format" mode */
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p, 0))
return(EPERM);
if (*(int *)data) {
diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c
index 865767cec23..5e4abf72251 100644
--- a/sys/arch/i386/i386/linux_machdep.c
+++ b/sys/arch/i386/i386/linux_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_machdep.c,v 1.28 2003/05/13 03:49:04 art Exp $ */
+/* $OpenBSD: linux_machdep.c,v 1.29 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
@@ -635,7 +635,7 @@ linux_sys_iopl(p, v, retval)
#endif
struct trapframe *fp = p->p_md.md_regs;
- if (suser(p->p_ucred, &p->p_acflag) != 0)
+ if (suser(p, 0) != 0)
return EPERM;
if (securelevel > 0)
return EPERM;
@@ -661,7 +661,7 @@ linux_sys_ioperm(p, v, retval)
} */ *uap = v;
struct trapframe *fp = p->p_md.md_regs;
- if (suser(p->p_ucred, &p->p_acflag) != 0)
+ if (suser(p, 0) != 0)
return EPERM;
if (securelevel > 0)
return EPERM;
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c
index f24eac1c19b..fe2edbf4b56 100644
--- a/sys/arch/i386/i386/mem.c
+++ b/sys/arch/i386/i386/mem.c
@@ -1,5 +1,5 @@
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.26 2003/06/02 23:27:47 millert Exp $ */
+/* $OpenBSD: mem.c,v 1.27 2003/08/15 20:32:13 tedu Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -90,7 +90,7 @@ mmopen(dev, flag, mode, p)
break;
#ifdef APERTURE
case 4:
- if (suser(p->p_ucred, &p->p_acflag) != 0 || !allowaperture)
+ if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() */
@@ -225,7 +225,7 @@ mmmmap(dev, off, prot)
/* minor device 0 is physical memory */
case 0:
if ((u_int)off > ctob(physmem) &&
- suser(p->p_ucred, &p->p_acflag) != 0)
+ suser(p, 0) != 0)
return -1;
return i386_btop((u_int)off);
diff --git a/sys/arch/i386/i386/sys_machdep.c b/sys/arch/i386/i386/sys_machdep.c
index e4afb9e9068..fa12399a187 100644
--- a/sys/arch/i386/i386/sys_machdep.c
+++ b/sys/arch/i386/i386/sys_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_machdep.c,v 1.21 2003/06/02 23:27:47 millert Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.22 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */
/*-
@@ -317,7 +317,7 @@ i386_iopl(p, args, retval)
struct trapframe *tf = p->p_md.md_regs;
struct i386_iopl_args ua;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return error;
#ifdef APERTURE
if (!allowaperture && securelevel > 0)
@@ -364,7 +364,7 @@ i386_set_ioperm(p, args, retval)
struct pcb *pcb = &p->p_addr->u_pcb;
struct i386_set_ioperm_args ua;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return error;
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c
index 88c1e849872..44ab6d562aa 100644
--- a/sys/arch/i386/isa/pccom.c
+++ b/sys/arch/i386/isa/pccom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccom.c,v 1.43 2003/06/02 23:27:47 millert Exp $ */
+/* $OpenBSD: pccom.c,v 1.44 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -1256,7 +1256,7 @@ comioctl(dev, cmd, data, flag, p)
case TIOCSFLAGS: {
int userbits, driverbits = 0;
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return(EPERM);
diff --git a/sys/arch/mac68k/dev/z8530tty.c b/sys/arch/mac68k/dev/z8530tty.c
index 707216f5bd0..bf4aac4db19 100644
--- a/sys/arch/mac68k/dev/z8530tty.c
+++ b/sys/arch/mac68k/dev/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.12 2003/06/02 23:27:49 millert Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.13 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: z8530tty.c,v 1.10 1996/12/18 05:17:44 scottr Exp $ */
/*
@@ -515,7 +515,7 @@ zsioctl(dev, cmd, data, flag, p)
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
tmp = *(int *)data;
@@ -539,21 +539,21 @@ zsioctl(dev, cmd, data, flag, p)
#if 0
case SetSafeOpen:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
zst->zst_resetdef = 1;
break;
case ClearSafeOpen:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
zst->zst_resetdef = 0;
break;
case SetOpenDefaults:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
bcopy(&tp->t_termios, &zst->zst_termios, \
diff --git a/sys/arch/macppc/dev/z8530tty.c b/sys/arch/macppc/dev/z8530tty.c
index 7387cd3145f..d7698c953f7 100644
--- a/sys/arch/macppc/dev/z8530tty.c
+++ b/sys/arch/macppc/dev/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.2 2003/06/02 23:27:49 millert Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.3 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: z8530tty.c,v 1.13 1996/10/16 20:42:14 gwr Exp $ */
/*-
@@ -754,7 +754,7 @@ zsioctl(dev, cmd, data, flag, p)
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
break;
zst->zst_swflags = *(int *)data;
diff --git a/sys/arch/macppc/macppc/mem.c b/sys/arch/macppc/macppc/mem.c
index 34706077a28..4b02cfcae85 100644
--- a/sys/arch/macppc/macppc/mem.c
+++ b/sys/arch/macppc/macppc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.9 2003/06/02 23:27:50 millert Exp $ */
+/* $OpenBSD: mem.c,v 1.10 2003/08/15 20:32:13 tedu Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -77,7 +77,7 @@ mmopen(dev, flag, mode, p)
break;
#ifdef APERTURE
case 4:
- if (suser(p->p_ucred, &p->p_acflag) != 0 || !allowaperture)
+ if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() */
diff --git a/sys/arch/mvme68k/dev/bugtty.c b/sys/arch/mvme68k/dev/bugtty.c
index 60d83bce682..5f9e6450009 100644
--- a/sys/arch/mvme68k/dev/bugtty.c
+++ b/sys/arch/mvme68k/dev/bugtty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugtty.c,v 1.9 2003/06/03 01:35:30 drahn Exp $ */
+/* $OpenBSD: bugtty.c,v 1.10 2003/08/15 20:32:14 tedu Exp $ */
/*
* Copyright (c) 1995 Dale Rahn.
@@ -407,7 +407,7 @@ bugttyioctl(dev, cmd, data, flag, p)
*(int *)data = SWFLAGS(dev);
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
diff --git a/sys/arch/mvme68k/dev/cl.c b/sys/arch/mvme68k/dev/cl.c
index ec914e82213..85693b3dff8 100644
--- a/sys/arch/mvme68k/dev/cl.c
+++ b/sys/arch/mvme68k/dev/cl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.c,v 1.30 2003/06/03 21:09:01 deraadt Exp $ */
+/* $OpenBSD: cl.c,v 1.31 2003/08/15 20:32:14 tedu Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -896,7 +896,7 @@ clioctl(dev, cmd, data, flag, p)
*(int *)data = cl->cl_swflags;
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return(EPERM);
diff --git a/sys/arch/mvme68k/dev/wl.c b/sys/arch/mvme68k/dev/wl.c
index 054af37a9f8..051cfc23d79 100644
--- a/sys/arch/mvme68k/dev/wl.c
+++ b/sys/arch/mvme68k/dev/wl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wl.c,v 1.11 2003/06/03 21:09:01 deraadt Exp $ */
+/* $OpenBSD: wl.c,v 1.12 2003/08/15 20:32:14 tedu Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -789,7 +789,7 @@ wlioctl(dev, cmd, data, flag, p)
*(int *)data = cl->cl_swflags;
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return(EPERM);
diff --git a/sys/arch/mvme88k/dev/bugtty.c b/sys/arch/mvme88k/dev/bugtty.c
index fe3cb501bee..18753ce6401 100644
--- a/sys/arch/mvme88k/dev/bugtty.c
+++ b/sys/arch/mvme88k/dev/bugtty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugtty.c,v 1.14 2003/06/03 21:09:01 deraadt Exp $ */
+/* $OpenBSD: bugtty.c,v 1.15 2003/08/15 20:32:14 tedu Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -421,7 +421,7 @@ bugttyioctl(dev, cmd, data, flag, p)
*(int *)data = SWFLAGS(dev);
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c
index c18fa08d089..718a12da8e0 100644
--- a/sys/arch/mvme88k/dev/cl.c
+++ b/sys/arch/mvme88k/dev/cl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.c,v 1.28 2003/06/03 21:09:01 deraadt Exp $ */
+/* $OpenBSD: cl.c,v 1.29 2003/08/15 20:32:14 tedu Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -875,7 +875,7 @@ clioctl(dev, cmd, data, flag, p)
*(int *)data = cl->cl_swflags;
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return(EPERM);
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c
index 643e50c6a5e..8d2c9f370e2 100644
--- a/sys/arch/mvme88k/dev/dart.c
+++ b/sys/arch/mvme88k/dev/dart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dart.c,v 1.19 2003/08/12 19:32:45 miod Exp $ */
+/* $OpenBSD: dart.c,v 1.20 2003/08/15 20:32:14 tedu Exp $ */
/*
* Mach Operating System
@@ -598,7 +598,7 @@ dartioctl(dev, cmd, data, flag, p)
*(int *)data = dart->dart_swflags;
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return(EPERM);
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c
index e4cef972926..2362ddc4fc1 100644
--- a/sys/arch/mvme88k/dev/vx.c
+++ b/sys/arch/mvme88k/dev/vx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vx.c,v 1.21 2003/06/03 21:09:01 deraadt Exp $ */
+/* $OpenBSD: vx.c,v 1.22 2003/08/15 20:32:14 tedu Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -778,7 +778,7 @@ vxioctl (dev, cmd, data, flag, p)
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
diff --git a/sys/arch/mvmeppc/dev/bugtty.c b/sys/arch/mvmeppc/dev/bugtty.c
index 8a66c2d3b83..be48c69e3be 100644
--- a/sys/arch/mvmeppc/dev/bugtty.c
+++ b/sys/arch/mvmeppc/dev/bugtty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugtty.c,v 1.7 2003/06/03 21:09:01 deraadt Exp $ */
+/* $OpenBSD: bugtty.c,v 1.8 2003/08/15 20:32:14 tedu Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -383,7 +383,7 @@ bugttyioctl(dev, cmd, data, flag, p)
*(int *)data = SWFLAGS(dev);
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
return (EPERM);
diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c
index e5f91cf9f06..60c457aa1bd 100644
--- a/sys/arch/sparc/dev/magma.c
+++ b/sys/arch/sparc/dev/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.14 2003/02/11 19:20:26 mickey Exp $ */
+/* $OpenBSD: magma.c,v 1.15 2003/08/15 20:32:14 tedu Exp $ */
/*
* magma.c
*
@@ -1110,7 +1110,7 @@ int error;
break;
case TIOCSFLAGS:
- if( suser(p->p_ucred, &p->p_acflag) )
+ if( suser(p, 0) )
error = EPERM;
else
mp->mp_openflags = *((int *)data) &
diff --git a/sys/arch/sparc/dev/spif.c b/sys/arch/sparc/dev/spif.c
index 46a92ca70af..c56255e8a49 100644
--- a/sys/arch/sparc/dev/spif.c
+++ b/sys/arch/sparc/dev/spif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spif.c,v 1.15 2003/06/02 18:40:59 jason Exp $ */
+/* $OpenBSD: spif.c,v 1.16 2003/08/15 20:32:14 tedu Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -451,7 +451,7 @@ sttyioctl(dev, cmd, data, flags, p)
*((int *)data) = sp->sp_openflags;
break;
case TIOCSFLAGS:
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p, 0))
error = EPERM;
else
sp->sp_openflags = *((int *)data) &
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index 68b8e1b19bc..553bd22de3c 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.24 2002/06/08 18:52:45 art Exp $ */
+/* $OpenBSD: xd.c,v 1.25 2003/08/15 20:32:14 tedu Exp $ */
/* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */
/*
@@ -899,7 +899,7 @@ xdioctl(dev, command, addr, flag, p)
case DIOSXDCMD:
xio = (struct xd_iocmd *) addr;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
return (xdc_ioctlcmd(xd, dev, xio));
diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c
index 1d943ebcb7a..fd38dc371d3 100644
--- a/sys/arch/sparc/dev/xy.c
+++ b/sys/arch/sparc/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.21 2002/06/08 18:52:45 art Exp $ */
+/* $OpenBSD: xy.c,v 1.22 2003/08/15 20:32:14 tedu Exp $ */
/* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */
/*
@@ -860,7 +860,7 @@ xyioctl(dev, command, addr, flag, p)
case DIOSXDCMD:
xio = (struct xd_iocmd *) addr;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p, 0)) != 0)
return (error);
return (xyc_ioctlcmd(xy, dev, xio));
diff --git a/sys/arch/sparc/dev/z8530tty.c b/sys/arch/sparc/dev/z8530tty.c
index 038d8b42ad2..d9e0f119b63 100644
--- a/sys/arch/sparc/dev/z8530tty.c
+++ b/sys/arch/sparc/dev/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.2 2003/06/02 23:27:54 millert Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.3 2003/08/15 20:32:14 tedu Exp $ */
/* $NetBSD: z8530tty.c,v 1.13 1996/10/16 20:42:14 gwr Exp $ */
/*-
@@ -749,7 +749,7 @@ zsioctl(dev, cmd, data, flag, p)
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error != 0)
break;
zst->zst_swflags = *(int *)data;
diff --git a/sys/arch/sparc64/dev/pcons.c b/sys/arch/sparc64/dev/pcons.c
index 7a7e1020851..d2a503d0484 100644
--- a/sys/arch/sparc64/dev/pcons.c
+++ b/sys/arch/sparc64/dev/pcons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcons.c,v 1.5 2002/03/14 03:16:00 millert Exp $ */
+/* $OpenBSD: pcons.c,v 1.6 2003/08/15 20:32:15 tedu Exp $ */
/* $NetBSD: pcons.c,v 1.7 2001/05/02 10:32:20 scw Exp $ */
/*-
@@ -191,7 +191,7 @@ pconsopen(dev, flag, mode, p)
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
pconsparam(tp, &tp->t_termios);
ttsetwater(tp);
- } else if ((tp->t_state&TS_XCLUDE) && suser(p->p_ucred, &p->p_acflag))
+ } else if ((tp->t_state&TS_XCLUDE) && suser(p, 0))
return EBUSY;
tp->t_state |= TS_CARR_ON;
diff --git a/sys/arch/sparc64/dev/sab.c b/sys/arch/sparc64/dev/sab.c
index fc22a641db7..14250d7f600 100644
--- a/sys/arch/sparc64/dev/sab.c
+++ b/sys/arch/sparc64/dev/sab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sab.c,v 1.13 2003/06/24 21:54:39 henric Exp $ */
+/* $OpenBSD: sab.c,v 1.14 2003/08/15 20:32:15 tedu Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -696,7 +696,7 @@ sabttyopen(dev, flags, mode, p)
else
tp->t_state &= ~TS_CARR_ON;
} else if ((tp->t_state & TS_XCLUDE) &&
- (!suser(p->p_ucred, &p->p_acflag))) {
+ (!suser(p, 0))) {
return (EBUSY);
} else {
s = spltty();
@@ -862,7 +862,7 @@ sabttyioctl(dev, cmd, data, flags, p)
*((int *)data) = sc->sc_openflags;
break;
case TIOCSFLAGS:
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p, 0))
error = EPERM;
else
sc->sc_openflags = *((int *)data) &
diff --git a/sys/arch/sparc64/dev/z8530tty.c b/sys/arch/sparc64/dev/z8530tty.c
index f9cb77836c8..a7c597e22bd 100644
--- a/sys/arch/sparc64/dev/z8530tty.c
+++ b/sys/arch/sparc64/dev/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.7 2003/06/02 23:27:55 millert Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.8 2003/08/15 20:32:15 tedu Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -720,7 +720,7 @@ zsioctl(dev, cmd, data, flag, p)
break;
case TIOCSFLAGS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if (error)
break;
zst->zst_swflags = *(int *)data;