summaryrefslogtreecommitdiff
path: root/sys/arch/i386
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/i386
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/i386')
-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
4 files changed, 11 insertions, 11 deletions
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);