summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
committerphk <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
commit16e3fbd2c114d665755299002f1c50dd11ba7245 (patch)
treed7f6bebfe177ae90b67d27603da4d211433088e5 /sys/i386
parentaba5e776bb95610ea3e3355cbf47aadb844773eb (diff)
downloadFreeBSD-src-16e3fbd2c114d665755299002f1c50dd11ba7245.zip
FreeBSD-src-16e3fbd2c114d665755299002f1c50dd11ba7245.tar.gz
Suser() simplification:
1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/cons.c4
-rw-r--r--sys/i386/i386/mem.c6
-rw-r--r--sys/i386/i386/sys_machdep.c4
-rw-r--r--sys/i386/ibcs2/ibcs2_misc.c6
-rw-r--r--sys/i386/ibcs2/ibcs2_socksys.c2
-rw-r--r--sys/i386/ibcs2/ibcs2_sysi86.c2
-rw-r--r--sys/i386/isa/atapi-cd.c4
-rw-r--r--sys/i386/isa/cx.c2
-rw-r--r--sys/i386/isa/cy.c8
-rw-r--r--sys/i386/isa/fd.c4
-rw-r--r--sys/i386/isa/if_wl.c12
-rw-r--r--sys/i386/isa/istallion.c8
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c4
-rw-r--r--sys/i386/isa/pcvt/pcvt_ext.c2
-rw-r--r--sys/i386/isa/rc.c4
-rw-r--r--sys/i386/isa/rp.c8
-rw-r--r--sys/i386/isa/si.c12
-rw-r--r--sys/i386/isa/spigot.c4
-rw-r--r--sys/i386/isa/stallion.c8
-rw-r--r--sys/i386/isa/wd_cd.c4
-rw-r--r--sys/i386/isa/wfd.c8
-rw-r--r--sys/i386/linux/linux_misc.c6
22 files changed, 61 insertions, 61 deletions
diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c
index 581ff3f..b565d5c 100644
--- a/sys/i386/i386/cons.c
+++ b/sys/i386/i386/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.59 1998/08/23 08:26:40 bde Exp $
+ * $Id: cons.c,v 1.61 1999/01/07 14:14:11 yokota Exp $
*/
#include "opt_devfs.h"
@@ -358,7 +358,7 @@ cnioctl(dev, cmd, data, flag, p)
* output from the "virtual" console.
*/
if (cmd == TIOCCONS && constty) {
- error = suser(p->p_ucred, (u_short *) NULL);
+ error = suser_xxx(p->p_ucred, (u_short *) NULL);
if (error)
return (error);
constty = NULL;
diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c
index 36fdd27..de75354 100644
--- a/sys/i386/i386/mem.c
+++ b/sys/i386/i386/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.54 1999/02/02 14:14:05 bde Exp $
+ * $Id: mem.c,v 1.55 1999/04/07 03:57:45 msmith Exp $
*/
/*
@@ -185,7 +185,7 @@ mmopen(dev, flags, fmt, p)
return ENODEV;
#endif
case 14:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
if (securelevel > 0)
@@ -552,7 +552,7 @@ random_ioctl(dev, cmd, data, flags, p)
* Even inspecting the state is privileged, since it gives a hint
* about how easily the randomness might be guessed.
*/
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c
index 17aa580..9c3df36 100644
--- a/sys/i386/i386/sys_machdep.c
+++ b/sys/i386/i386/sys_machdep.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
- * $Id: sys_machdep.c,v 1.38 1998/12/07 21:58:19 archie Exp $
+ * $Id: sys_machdep.c,v 1.39 1999/01/28 01:59:50 dillon Exp $
*
*/
@@ -185,7 +185,7 @@ i386_set_ioperm(p, args)
if ((error = copyin(args, &ua, sizeof(struct i386_ioperm_args))) != 0)
return (error);
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if (securelevel > 0)
return (EPERM);
diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c
index 6cbb575..aff36c8 100644
--- a/sys/i386/ibcs2/ibcs2_misc.c
+++ b/sys/i386/ibcs2/ibcs2_misc.c
@@ -45,7 +45,7 @@
*
* @(#)sun_misc.c 8.1 (Berkeley) 6/18/93
*
- * $Id: ibcs2_misc.c,v 1.30 1998/09/26 00:55:53 des Exp $
+ * $Id: ibcs2_misc.c,v 1.31 1999/01/28 01:59:52 dillon Exp $
*/
/*
@@ -993,7 +993,7 @@ ibcs2_plock(p, uap)
#define IBCS2_DATALOCK 4
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p)) != 0)
return EPERM;
switch(SCARG(uap, cmd)) {
case IBCS2_UNLOCK:
@@ -1028,7 +1028,7 @@ ibcs2_uadmin(p, uap)
#define SCO_AD_GETBMAJ 0
#define SCO_AD_GETCMAJ 1
- if (suser(p->p_ucred, &p->p_acflag))
+ if (suser(p))
return EPERM;
switch(SCARG(uap, cmd)) {
diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c
index 0f5ee4d..16d964e 100644
--- a/sys/i386/ibcs2/ibcs2_socksys.c
+++ b/sys/i386/ibcs2/ibcs2_socksys.c
@@ -169,7 +169,7 @@ ibcs2_setipdomainname(p, uap)
char hname[MAXHOSTNAMELEN], *ptr;
int error, sctl[2], hlen;
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
return (error);
/* W/out a hostname a domain-name is nonsense */
diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c
index 210c268..bcc758b 100644
--- a/sys/i386/ibcs2/ibcs2_sysi86.c
+++ b/sys/i386/ibcs2/ibcs2_sysi86.c
@@ -73,7 +73,7 @@ ibcs2_sysi86(struct proc *p, struct ibcs2_sysi86_args *args)
int name[2];
int error;
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
return (error);
name[0] = CTL_KERN;
name[1] = KERN_HOSTNAME;
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index 138323e..e8f7add 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.13 1999/03/31 12:30:58 sos Exp $
+ * $Id: atapi-cd.c,v 1.14 1999/04/13 19:38:10 peter Exp $
*/
#include "wdc.h"
@@ -678,7 +678,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
case CDIOCRESET:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return (error);
return acd_request_wait(cdp, ATAPI_TEST_UNIT_READY,
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index 4efdb50..9a4a09e 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -153,7 +153,7 @@ int cxopen (dev_t dev, int flag, int mode, struct proc *p)
tp = c->ttyp;
tp->t_dev = dev;
if ((tp->t_state & TS_ISOPEN) && (tp->t_state & TS_XCLUDE) &&
- suser(p->p_ucred, &p->p_acflag))
+ suser(p))
return (EBUSY);
if (! (tp->t_state & TS_ISOPEN)) {
ttychars (tp);
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index e513c05..6947d09 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.85 1999/01/30 12:17:33 phk Exp $
+ * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $
*/
#include "opt_compat.h"
@@ -718,7 +718,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1623,7 +1623,7 @@ sioioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1722,7 +1722,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c
index 0414b18..d465911 100644
--- a/sys/i386/isa/fd.c
+++ b/sys/i386/isa/fd.c
@@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.134 1999/04/06 03:06:51 peter Exp $
+ * $Id: fd.c,v 1.135 1999/04/16 21:22:19 peter Exp $
*
*/
@@ -2299,7 +2299,7 @@ fdioctl(dev, cmd, addr, flag, p)
case FD_STYPE: /* set drive type */
/* this is considered harmful; only allow for superuser */
- if (suser(p->p_ucred, &p->p_acflag) != 0)
+ if (suser(p) != 0)
return EPERM;
*fd->ft = *(struct fd_type *)addr;
break;
diff --git a/sys/i386/isa/if_wl.c b/sys/i386/isa/if_wl.c
index 42fc0f9..3370477 100644
--- a/sys/i386/isa/if_wl.c
+++ b/sys/i386/isa/if_wl.c
@@ -1,4 +1,4 @@
-/* $Id: if_wl.c,v 1.19 1998/12/09 03:30:51 eivind Exp $ */
+/* $Id: if_wl.c,v 1.20 1999/01/12 00:36:31 eivind Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1294,7 +1294,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* pointer to buffer in user space */
up = (void *)ifr->ifr_data;
/* work out if they're root */
- isroot = (suser(p->p_ucred, &p->p_acflag) == 0);
+ isroot = (suser(p) == 0);
for (i = 0; i < 0x40; i++) {
/* don't hand the DES key out to non-root users */
@@ -1309,7 +1309,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* copy the PSA in from the caller; we only copy _some_ values */
case SIOCSWLPSA:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
error = EINVAL; /* assume the worst */
/* pointer to buffer in user space containing data */
@@ -1363,7 +1363,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
*/
case SIOCSWLCNWID:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
if (!(ifp->if_flags & IFF_UP)) {
error = EIO; /* only allowed while up */
@@ -1381,7 +1381,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* copy the EEPROM in 2.4 Gz WaveMODEM out to the caller */
case SIOCGWLEEPROM:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
/* pointer to buffer in user space */
up = (void *)ifr->ifr_data;
@@ -1404,7 +1404,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* zero (Delete) the wl cache */
case SIOCDWLCACHE:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
wl_cache_zero(unit);
break;
diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c
index e4040f7..07fd937 100644
--- a/sys/i386/isa/istallion.c
+++ b/sys/i386/isa/istallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: istallion.c,v 1.23 1999/01/12 01:17:01 eivind Exp $
+ * $Id: istallion.c,v 1.24 1999/01/30 12:17:33 phk Exp $
*/
/*****************************************************************************/
@@ -1010,7 +1010,7 @@ stliopen_restart:
}
}
if ((tp->t_state & TS_XCLUDE) &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto stliopen_end;
}
@@ -1203,7 +1203,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
switch (cmd) {
case TIOCSETA:
- if ((error = suser(p->p_ucred, &p->p_acflag)) == 0)
+ if ((error = suser(p)) == 0)
*localtios = *((struct termios *) data);
break;
case TIOCGETA:
@@ -1339,7 +1339,7 @@ STATIC int stliioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
*((int *) data) = (portp->sigs | TIOCM_LE);
break;
case TIOCMSDTRWAIT:
- if ((error = suser(p->p_ucred, &p->p_acflag)) == 0)
+ if ((error = suser(p)) == 0)
portp->dtrwait = *((int *) data) * hz / 100;
break;
case TIOCMGDTRWAIT:
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index 275fed0..a72bc32 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -513,7 +513,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p)
(*linesw[tp->t_line].l_modem)(tp, 1); /* fake connection */
winsz = 1; /* set winsize later */
}
- else if (tp->t_state & TS_XCLUDE && suser(p->p_ucred, &p->p_acflag))
+ else if (tp->t_state & TS_XCLUDE && suser(p))
return (EBUSY);
#if PCVT_NETBSD || (PCVT_FREEBSD >= 200)
@@ -1444,7 +1444,7 @@ pcvt_xmode_set(int on, struct proc *p)
* This prevents us from granting the potential security hole
* `IO priv' to insufficiently privileged processes.
*/
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
if (securelevel > 0)
diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c
index acf066a..c0b4a99 100644
--- a/sys/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/i386/isa/pcvt/pcvt_ext.c
@@ -2680,7 +2680,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
struct syscframe *fp = (struct syscframe *)p->p_regs;
#endif
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
if (securelevel > 0)
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index a5d96ec..ca9032e 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -767,7 +767,7 @@ again:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1144,7 +1144,7 @@ struct proc *p;
break;
case TIOCMSDTRWAIT:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c
index 9a95809..39972dd 100644
--- a/sys/i386/isa/rp.c
+++ b/sys/i386/isa/rp.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: $
+ * $Id: rp.c,v 1.23 1999/04/24 20:26:12 billf Exp $
*/
/*
@@ -1341,7 +1341,7 @@ open_top:
}
}
if(tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
splx(oldspl);
return(EBUSY);
}
@@ -1614,7 +1614,7 @@ rpioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if(error != 0)
return(error);
*ct = *(struct termios *)data;
@@ -1759,7 +1759,7 @@ rpioctl(dev, cmd, data, flag, p)
*(int *)data = result;
break;
case TIOCMSDTRWAIT:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if(error != 0) {
splx(oldspl);
return(error);
diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c
index 7dae243..670ef14 100644
--- a/sys/i386/isa/si.c
+++ b/sys/i386/isa/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.79 1999/01/30 12:17:34 phk Exp $
+ * $Id: si.c,v 1.80 1999/04/24 20:17:03 peter Exp $
*/
#ifndef lint
@@ -1132,7 +1132,7 @@ siopen(dev, flag, mode, p)
/* quickly let in /dev/si_control */
if (IS_CONTROLDEV(mynor)) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
return(error);
return(0);
}
@@ -1210,7 +1210,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
DPRINT((pp, DBG_OPEN|DBG_FAIL,
"already open and EXCLUSIVE set\n"));
error = EBUSY;
@@ -1525,7 +1525,7 @@ siioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1635,7 +1635,7 @@ siioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
goto outspl;
}
@@ -1692,7 +1692,7 @@ si_Sioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ip = (int *)data;
-#define SUCHECK if ((error = suser(p->p_ucred, &p->p_acflag))) goto out
+#define SUCHECK if ((error = suser(p))) goto out
switch (cmd) {
case TCSIPORTS:
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index e0f33a7..f767d7f 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -166,7 +166,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
* require sufficient privilege soon and nothing much can be done
* without them.
*/
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return error;
if (securelevel > 0)
@@ -222,7 +222,7 @@ struct spigot_info *info;
break;
case SPIGOT_IOPL_ON: /* allow access to the IO PAGE */
#if !defined(SPIGOT_UNSECURE)
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return error;
if (securelevel > 0)
diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c
index e90a829..9bb4890 100644
--- a/sys/i386/isa/stallion.c
+++ b/sys/i386/isa/stallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: stallion.c,v 1.25 1999/01/30 12:17:34 phk Exp $
+ * $Id: stallion.c,v 1.26 1999/04/24 20:17:04 peter Exp $
*/
/*****************************************************************************/
@@ -830,7 +830,7 @@ stlopen_restart:
}
}
if ((tp->t_state & TS_XCLUDE) &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto stlopen_end;
}
@@ -1013,7 +1013,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
switch (cmd) {
case TIOCSETA:
- if ((error = suser(p->p_ucred, &p->p_acflag)) == 0)
+ if ((error = suser(p)) == 0)
*localtios = *((struct termios *) data);
break;
case TIOCGETA:
@@ -1131,7 +1131,7 @@ STATIC int stlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag,
*((int *) data) = (stl_getsignals(portp) | TIOCM_LE);
break;
case TIOCMSDTRWAIT:
- if ((error = suser(p->p_ucred, &p->p_acflag)) == 0)
+ if ((error = suser(p)) == 0)
portp->dtrwait = *((int *) data) * hz / 100;
break;
case TIOCMGDTRWAIT:
diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c
index 138323e..e8f7add 100644
--- a/sys/i386/isa/wd_cd.c
+++ b/sys/i386/isa/wd_cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.13 1999/03/31 12:30:58 sos Exp $
+ * $Id: atapi-cd.c,v 1.14 1999/04/13 19:38:10 peter Exp $
*/
#include "wdc.h"
@@ -678,7 +678,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
case CDIOCRESET:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return (error);
return acd_request_wait(cdp, ATAPI_TEST_UNIT_READY,
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c
index f2fb145..6f42292 100644
--- a/sys/i386/isa/wfd.c
+++ b/sys/i386/isa/wfd.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: wfd.c,v 1.19 1999/02/10 00:03:37 ken Exp $
+ * $Id: wfd.c,v 1.20 1999/04/13 19:38:11 peter Exp $
*/
/*
@@ -675,21 +675,21 @@ int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
}
switch (cmd) {
case CDIOCSETDEBUG:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return (error);
t->flags |= F_DEBUG;
atapi_debug (t->ata, 1);
return 0;
case CDIOCCLRDEBUG:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return (error);
t->flags &= ~F_DEBUG;
atapi_debug (t->ata, 0);
return 0;
case CDIOCRESET:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return (error);
return wfd_request_wait (t, ATAPI_TEST_UNIT_READY,
diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c
index 4ba58ad..013882e 100644
--- a/sys/i386/linux/linux_misc.c
+++ b/sys/i386/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.53 1999/03/02 00:28:07 julian Exp $
+ * $Id: linux_misc.c,v 1.54 1999/04/19 14:14:14 peter Exp $
*/
#include <sys/param.h>
@@ -1104,7 +1104,7 @@ linux_iopl(struct proc *p, struct linux_iopl_args *args)
{
int error;
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return error;
if (securelevel > 0)
@@ -1134,7 +1134,7 @@ linux_setgroups(p, uap)
gid_t *bsd_gidset;
int ngrp, error;
- if ((error = suser(pc->pc_ucred, &p->p_acflag)))
+ if ((error = suser_xxx(pc->pc_ucred, &p->p_acflag)))
return error;
if (uap->gidsetsize > NGROUPS)
OpenPOWER on IntegriCloud