diff options
author | phk <phk@FreeBSD.org> | 1999-04-27 11:18:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-04-27 11:18:52 +0000 |
commit | 16e3fbd2c114d665755299002f1c50dd11ba7245 (patch) | |
tree | d7f6bebfe177ae90b67d27603da4d211433088e5 /sys | |
parent | aba5e776bb95610ea3e3355cbf47aadb844773eb (diff) | |
download | FreeBSD-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')
128 files changed, 399 insertions, 394 deletions
diff --git a/sys/alpha/alpha/cons.c b/sys/alpha/alpha/cons.c index ad8465a..d25c010 100644 --- a/sys/alpha/alpha/cons.c +++ b/sys/alpha/alpha/cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.2 1998/06/14 13:44:40 dfr Exp $ + * $Id: cons.c,v 1.3 1998/12/09 02:26:45 eivind Exp $ */ #include "opt_devfs.h" @@ -368,7 +368,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/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c index 26a6f96..0eab748 100644 --- a/sys/alpha/alpha/mem.c +++ b/sys/alpha/alpha/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.4 1999/01/12 10:54:14 dfr Exp $ + * $Id: mem.c,v 1.5 1999/04/23 19:53:38 dt Exp $ */ /* @@ -324,7 +324,7 @@ mmioctl(dev, cmd, cmdarg, flags, p) #if 0 /* Only root can do this */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) { return (error); } diff --git a/sys/alpha/alpha/promcons.c b/sys/alpha/alpha/promcons.c index 2a18646..afaaaee 100644 --- a/sys/alpha/alpha/promcons.c +++ b/sys/alpha/alpha/promcons.c @@ -1,4 +1,4 @@ -/* $Id: promcons.c,v 1.3 1998/07/12 16:15:02 dfr Exp $ */ +/* $Id: promcons.c,v 1.4 1999/01/30 12:17:22 phk Exp $ */ /* $NetBSD: promcons.c,v 1.13 1998/03/21 22:52:59 mycroft Exp $ */ /* @@ -117,7 +117,7 @@ promopen(dev, flag, mode, p) setuptimeout = 1; } else if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { splx(s); return EBUSY; } diff --git a/sys/alpha/alpha/sys_machdep.c b/sys/alpha/alpha/sys_machdep.c index 307bef2..0339d18 100644 --- a/sys/alpha/alpha/sys_machdep.c +++ b/sys/alpha/alpha/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.3 1998/12/23 11:50:50 dfr Exp $ + * $Id: sys_machdep.c,v 1.4 1999/04/23 19:53:38 dt Exp $ * */ @@ -109,7 +109,7 @@ alpha_sethae(struct proc *p, char *args) if (securelevel > 0) return (EPERM); - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); diff --git a/sys/alpha/tlsb/zs_tlsb.c b/sys/alpha/tlsb/zs_tlsb.c index 0bfa15d..9e92edb 100644 --- a/sys/alpha/tlsb/zs_tlsb.c +++ b/sys/alpha/tlsb/zs_tlsb.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: zs_tlsb.c,v 1.6 1998/11/15 18:25:16 dfr Exp $ + * $Id: zs_tlsb.c,v 1.7 1999/01/30 12:17:29 phk Exp $ */ /* * This driver is a hopeless hack to get the SimOS console working. A real @@ -269,7 +269,7 @@ zsopen(dev_t dev, int flag, int mode, struct proc *p) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; ttsetwater(tp); } else if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { splx(s); return EBUSY; } diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index 36fdd27..de75354 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/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/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 17aa580..9c3df36 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/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/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 4ba58ad..013882e 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/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) diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index 9bd403c..b6e9b9a 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -275,7 +275,7 @@ fd_revoke(p, fd) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && - (error = suser(p->p_ucred, &p->p_acflag)) != 0) + (error = suser(p)) != 0) goto out; if (vp->v_usecount > 1 || (vp->v_flag & VALIASED)) diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 1d0065f..262fd06 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -560,7 +560,7 @@ svr4_sys_fchroot(p, uap) struct file *fp; int error; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) return error; diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 99448ba..31cf8f0 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -587,13 +587,13 @@ svr4_sys_systeminfo(p, uap) break; #if defined(WHY_DOES_AN_EMULATOR_WANT_TO_SET_HOSTNAMES) case SVR4_SI_SET_HOSTNAME: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; name = KERN_HOSTNAME; return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, p); case SVR4_SI_SET_SRPC_DOMAIN: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; name = KERN_NISDOMAINNAME; return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, p); diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index ad712e7..38581cb 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/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.4 1999/03/28 18:57:19 sos Exp $ + * $Id: atapi-cd.c,v 1.5 1999/04/10 18:53:35 sos Exp $ */ #include "ata.h" @@ -510,7 +510,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) return acd_lock_device(cdp, 1); case CDIOCRESET: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return error; return acd_test_unit_ready(cdp); diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index e513c05..6947d09 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/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/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index e513c05..6947d09 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.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/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c index 1e53116..c640622 100644 --- a/sys/dev/dgb/dgb.c +++ b/sys/dev/dgb/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.43 1999/03/13 13:20:54 joerg Exp $ + * dgb.c $Id: dgb.c,v 1.44 1999/04/22 15:19:37 davidn Exp $ * * Digiboard driver. * @@ -1034,7 +1034,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1579,7 +1579,7 @@ dgbioctl(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; @@ -1801,7 +1801,7 @@ dgbioctl(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/dev/dgb/dgm.c b/sys/dev/dgb/dgm.c index 68ef91c..97ff12f 100644 --- a/sys/dev/dgb/dgm.c +++ b/sys/dev/dgb/dgm.c @@ -1,5 +1,5 @@ /*- - * $Id: dgm.c,v 1.7 1999/01/30 12:17:32 phk Exp $ + * $Id: dgm.c,v 1.8 1999/04/11 03:47:24 eivind Exp $ * * This driver and the associated header files support the ISA PC/Xem * Digiboards. Its evolutionary roots are described below. @@ -834,7 +834,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1378,7 +1378,7 @@ dgmioctl(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; @@ -1600,7 +1600,7 @@ dgmioctl(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/dev/en/midway.c b/sys/dev/en/midway.c index d462c4f..a3db462 100644 --- a/sys/dev/en/midway.c +++ b/sys/dev/en/midway.c @@ -1262,7 +1262,7 @@ caddr_t data; #ifdef ATM_PVCEXT case SIOCSPVCTX: - if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) == 0) + if ((error = suser(curproc)) == 0) error = en_pvctx(sc, (struct pvctxreq *)data); break; @@ -1274,7 +1274,7 @@ caddr_t data; do { struct ifnet *shadow; - if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) != 0) + if ((error = suser(curproc)) != 0) break; if ((shadow = pvc_attach(ifp)) != NULL) { diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 0414b18..d465911 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.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/dev/rc/rc.c b/sys/dev/rc/rc.c index a5d96ec..ca9032e 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/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/dev/rp/rp.c b/sys/dev/rp/rp.c index 9a95809..39972dd 100644 --- a/sys/dev/rp/rp.c +++ b/sys/dev/rp/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/dev/si/si.c b/sys/dev/si/si.c index 7dae243..670ef14 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/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/dev/sio/sio.c b/sys/dev/sio/sio.c index dc42b0a..4c62ca9 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.226 1999/04/18 14:35:28 peter Exp $ + * $Id: sio.c,v 1.227 1999/04/24 10:41:21 dt Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -1207,7 +1207,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1862,7 +1862,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; @@ -1953,7 +1953,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/dev/snp/snp.c b/sys/dev/snp/snp.c index 686aa27..0a1438d 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -291,7 +291,7 @@ snpopen(dev, flag, mode, p) struct snoop *snp; register int unit, error; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); if ((unit = minor(dev)) >= NSNP) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index a2db9b4..1f8377e 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.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: syscons.c,v 1.299 1999/03/10 10:36:53 yokota Exp $ + * $Id: syscons.c,v 1.300 1999/04/16 21:21:56 peter Exp $ */ #include "sc.h" @@ -709,7 +709,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) mouse_level = 0; /* XXX */ } else - if (tp->t_state & TS_XCLUDE && suser(p->p_ucred, &p->p_acflag)) + if (tp->t_state & TS_XCLUDE && suser(p)) return(EBUSY); if (minor(dev) < MAXCONS && !console[minor(dev)]) { console[minor(dev)] = alloc_scp(); @@ -1537,7 +1537,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) return 0; case KDENABIO: /* allow io operations */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error != 0) return error; if (securelevel > 0) diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c index d2389da..86c8fc0 100644 --- a/sys/dev/vinum/vinum.c +++ b/sys/dev/vinum/vinum.c @@ -33,7 +33,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinum.c,v 1.24 1999/03/19 05:35:25 grog Exp grog $ + * $Id: vinum.c,v 1.17 1999/04/17 04:15:50 grog Exp $ */ #define STATIC static /* nothing while we're testing XXX */ @@ -347,7 +347,7 @@ vinumopen(dev_t dev, return ENODEV; /* don't know what to do with these */ case VINUM_SUPERDEV_TYPE: - error = suser(p->p_ucred, &p->p_acflag); /* are we root? */ + error = suser(p); /* are we root? */ if (error == 0) { /* yes, can do */ if (dev == VINUM_DAEMON_DEV) /* daemon device */ vinum_conf.flags |= VF_DAEMONOPEN; /* we're open */ diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index d4e2440..11cbd01 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -38,7 +38,7 @@ * from: Utah Hdr: vn.c 1.13 94/04/02 * * from: @(#)vn.c 8.6 (Berkeley) 4/1/94 - * $Id: vn.c,v 1.74 1999/02/01 08:36:02 dillon Exp $ + * $Id: vn.c,v 1.75 1999/03/14 09:20:00 julian Exp $ */ /* @@ -409,7 +409,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) vn_specific: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index 42fc0f9..3370477 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/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/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 06e3142..5507a1a 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.51 1999/01/31 11:54:29 bde Exp $ + * $Id: cd9660_vfsops.c,v 1.52 1999/04/18 10:58:02 dcs Exp $ */ #include <sys/param.h> @@ -239,7 +239,7 @@ cd9660_mount(mp, path, data, ndp, p) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p); if (error) - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) { vput(devvp); return (error); diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 36aa91d..00f576b 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.80 1998/12/07 21:58:35 archie Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.81 1999/01/27 22:42:09 dillon Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -431,7 +431,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return (error); /* * We are very inconsistent about handling unsupported @@ -472,7 +472,7 @@ msdosfs_setattr(ap) gid = pmp->pm_gid; if ((cred->cr_uid != pmp->pm_uid || uid != pmp->pm_uid || (gid != pmp->pm_gid && !groupmember(gid, cred))) && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return error; if (uid != pmp->pm_uid || gid != pmp->pm_gid) return EINVAL; @@ -504,7 +504,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag)) && + (error = suser_xxx(cred, &ap->a_p->p_acflag)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_p)))) return (error); @@ -527,7 +527,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return (error); if (vp->v_type != VDIR) { /* We ignore the read and execute bits. */ diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index 619e1b2..180a47f 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/procfs/procfs.h @@ -37,7 +37,7 @@ * @(#)procfs.h 8.9 (Berkeley) 5/14/95 * * From: - * $Id: procfs.h,v 1.20 1998/07/07 04:08:44 bde Exp $ + * $Id: procfs.h,v 1.21 1999/01/05 03:53:06 peter Exp $ */ /* @@ -95,8 +95,7 @@ struct pfsnode { ((((p1)->p_cred->pc_ucred->cr_uid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_ruid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_svuid == (p2)->p_cred->p_ruid) && \ - ((p2)->p_flag & P_SUGID) == 0) || \ - (suser((p1)->p_cred->pc_ucred, &(p1)->p_acflag) == 0)) + ((p2)->p_flag & P_SUGID) == 0) || (suser((p1)) == 0)) /* * Format of a directory entry in /proc, ... diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 22d8f74..4ca115f 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -37,7 +37,7 @@ * * @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 * - * $Id: procfs_mem.c,v 1.34 1998/07/15 02:32:19 bde Exp $ + * $Id: procfs_mem.c,v 1.35 1998/10/28 13:37:00 dg Exp $ */ /* @@ -331,7 +331,7 @@ int procfs_kmemaccess(curp) struct ucred *cred; cred = curp->p_cred->pc_ucred; - if (suser(cred, &curp->p_acflag)) + if (suser_xxx(cred, &curp->p_acflag)) return 1; for (i = 0; i < cred->cr_ngroups; i++) diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 1aa5453..ffab3e8 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.63 1999/01/05 03:53:06 peter Exp $ + * $Id: procfs_vnops.c,v 1.64 1999/01/27 22:42:07 dillon Exp $ */ /* @@ -246,12 +246,12 @@ procfs_ioctl(ap) break; case PIOCSFL: /* - * NFLAGS is "non-suser flags" -- currently, only + * NFLAGS is "non-suser_xxx flags" -- currently, only * PFS_ISUGID ("ignore set u/g id"); */ #define NFLAGS (PF_ISUGID) flags = (unsigned char)*(unsigned int*)ap->a_data; - if (flags & NFLAGS && (error = suser(p->p_ucred, &p->p_acflag))) + if (flags & NFLAGS && (error = suser(p))) return error; procp->p_pfsflags = flags; break; diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index 3ad41cf..3acc700 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $Id: umap_vfsops.c,v 1.23 1998/09/07 13:17:01 bde Exp $ + * $Id: umap_vfsops.c,v 1.24 1999/03/12 19:40:39 imp Exp $ */ /* @@ -98,7 +98,7 @@ umapfs_mount(mp, path, data, ndp, p) /* * Only for root */ - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); #ifdef UMAPFS_DIAGNOSTIC diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index 006687b..9f6a965 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -1157,7 +1157,7 @@ ext2_makeinode(mode, dvp, vpp, cnp) tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_nlink = 1; if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) && - suser(cnp->cn_cred, NULL)) + suser_xxx(cnp->cn_cred, NULL)) ip->i_mode &= ~ISGID; if (cnp->cn_flags & ISWHITEOUT) diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 006687b..9f6a965 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -1157,7 +1157,7 @@ ext2_makeinode(mode, dvp, vpp, cnp) tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_nlink = 1; if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) && - suser(cnp->cn_cred, NULL)) + suser_xxx(cnp->cn_cred, NULL)) ip->i_mode &= ~ISGID; if (cnp->cn_flags & ISWHITEOUT) diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c index 1e53116..c640622 100644 --- a/sys/gnu/i386/isa/dgb.c +++ b/sys/gnu/i386/isa/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.43 1999/03/13 13:20:54 joerg Exp $ + * dgb.c $Id: dgb.c,v 1.44 1999/04/22 15:19:37 davidn Exp $ * * Digiboard driver. * @@ -1034,7 +1034,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1579,7 +1579,7 @@ dgbioctl(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; @@ -1801,7 +1801,7 @@ dgbioctl(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/gnu/i386/isa/dgm.c b/sys/gnu/i386/isa/dgm.c index 68ef91c..97ff12f 100644 --- a/sys/gnu/i386/isa/dgm.c +++ b/sys/gnu/i386/isa/dgm.c @@ -1,5 +1,5 @@ /*- - * $Id: dgm.c,v 1.7 1999/01/30 12:17:32 phk Exp $ + * $Id: dgm.c,v 1.8 1999/04/11 03:47:24 eivind Exp $ * * This driver and the associated header files support the ISA PC/Xem * Digiboards. Its evolutionary roots are described below. @@ -834,7 +834,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1378,7 +1378,7 @@ dgmioctl(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; @@ -1600,7 +1600,7 @@ dgmioctl(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/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) diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c index f7391d5..9182a54 100644 --- a/sys/i4b/driver/i4b_ipr.c +++ b/sys/i4b/driver/i4b_ipr.c @@ -27,7 +27,7 @@ * i4b_ipr.c - isdn4bsd IP over raw HDLC ISDN network driver * --------------------------------------------------------- * - * $Id: i4b_ipr.c,v 1.44 1999/02/14 19:51:01 hm Exp $ + * $Id: i4b_ipr.c,v 1.2 1999/03/07 16:08:13 hm Exp $ * * last edit-date: [Sun Feb 14 10:02:36 1999] * @@ -571,7 +571,7 @@ i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case IPRIOCSMAXCID: { struct proc *p = curproc; /* XXX */ - if((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if((error = suser(p)) != 0) return (error); sl_compress_setup(sc->sc_compr, *(int *)data); } diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 0414b18..d465911 100644 --- a/sys/isa/fd.c +++ b/sys/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/isa/sio.c b/sys/isa/sio.c index dc42b0a..4c62ca9 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.226 1999/04/18 14:35:28 peter Exp $ + * $Id: sio.c,v 1.227 1999/04/24 10:41:21 dt Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -1207,7 +1207,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -1862,7 +1862,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; @@ -1953,7 +1953,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/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 06e3142..5507a1a 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.51 1999/01/31 11:54:29 bde Exp $ + * $Id: cd9660_vfsops.c,v 1.52 1999/04/18 10:58:02 dcs Exp $ */ #include <sys/param.h> @@ -239,7 +239,7 @@ cd9660_mount(mp, path, data, ndp, p) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p); if (error) - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) { vput(devvp); return (error); diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 11db4e9..61e49ab 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 - * $Id: kern_acct.c,v 1.18 1997/11/06 19:29:07 phk Exp $ + * $Id: kern_acct.c,v 1.19 1998/06/05 21:44:19 dg Exp $ */ #include <sys/param.h> @@ -119,7 +119,7 @@ acct(a1, uap) int error; /* Make sure that the caller is root. */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 9e85104..cb7fe3c 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.97 1999/04/03 22:20:01 jdp Exp $ + * $Id: kern_exec.c,v 1.98 1999/04/19 14:14:09 peter Exp $ */ #include <sys/param.h> @@ -264,7 +264,7 @@ interpret: * Turn off syscall tracing for set-id programs, except for * root. */ - if (p->p_tracep && suser(p->p_ucred, &p->p_acflag)) { + if (p->p_tracep && suser(p)) { p->p_traceflag = 0; vrele(p->p_tracep); p->p_tracep = NULL; diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 4fe03e1..b184a98 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_linker.c,v 1.28 1999/03/07 16:06:41 dfr Exp $ + * $Id: kern_linker.c,v 1.29 1999/04/06 03:02:11 peter Exp $ */ #include "opt_ddb.h" @@ -678,7 +678,7 @@ kldload(struct proc* p, struct kldload_args* uap) if (securelevel > 0) return EPERM; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; filename = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); @@ -717,7 +717,7 @@ kldunload(struct proc* p, struct kldunload_args* uap) if (securelevel > 0) return EPERM; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; lf = linker_find_file_by_id(SCARG(uap, fileid)); diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 2dea507..0b85fbd 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -282,7 +282,7 @@ ntp_adjtime(struct proc *p, struct ntp_adjtime_args *uap) */ modes = ntv.modes; if (modes) - error = suser(p->p_cred->pc_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); s = splclock(); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 728e430..c5224d6 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 - * $Id: kern_prot.c,v 1.43 1998/12/13 07:07:51 truckman Exp $ + * $Id: kern_prot.c,v 1.44 1999/01/28 00:57:47 dillon Exp $ */ /* @@ -395,7 +395,7 @@ setuid(p, uap) #ifdef POSIX_APPENDIX_B_4_2_2 /* Use BSD-compat clause from B.4.2.2 */ uid != pc->pc_ucred->cr_uid && /* allow setuid(geteuid()) */ #endif - (error = suser(pc->pc_ucred, &p->p_acflag))) + (error = suser_xxx(pc->pc_ucred, &p->p_acflag))) return (error); #ifdef _POSIX_SAVED_IDS @@ -407,7 +407,7 @@ setuid(p, uap) #ifdef POSIX_APPENDIX_B_4_2_2 /* Use the clause from B.4.2.2 */ uid == pc->pc_ucred->cr_uid || #endif - suser(pc->pc_ucred, &p->p_acflag) == 0) /* we are using privs */ + suser_xxx(pc->pc_ucred, &p->p_acflag) == 0) /* we are using privs */ #endif { /* @@ -467,7 +467,7 @@ seteuid(p, uap) euid = uap->euid; if (euid != pc->p_ruid && /* allow seteuid(getuid()) */ euid != pc->p_svuid && /* allow seteuid(saved uid) */ - (error = suser(pc->pc_ucred, &p->p_acflag))) + (error = suser_xxx(pc->pc_ucred, &p->p_acflag))) return (error); /* * Everything's okay, do it. Copy credentials so other references do @@ -515,7 +515,7 @@ setgid(p, uap) #ifdef POSIX_APPENDIX_B_4_2_2 /* Use BSD-compat clause from B.4.2.2 */ gid != pc->pc_ucred->cr_groups[0] && /* allow setgid(getegid()) */ #endif - (error = suser(pc->pc_ucred, &p->p_acflag))) + (error = suser_xxx(pc->pc_ucred, &p->p_acflag))) return (error); #ifdef _POSIX_SAVED_IDS @@ -527,7 +527,7 @@ setgid(p, uap) #ifdef POSIX_APPENDIX_B_4_2_2 /* use the clause from B.4.2.2 */ gid == pc->pc_ucred->cr_groups[0] || #endif - suser(pc->pc_ucred, &p->p_acflag) == 0) /* we are using privs */ + suser_xxx(pc->pc_ucred, &p->p_acflag) == 0) /* we are using privs */ #endif { /* @@ -579,7 +579,7 @@ setegid(p, uap) egid = uap->egid; if (egid != pc->p_rgid && /* allow setegid(getgid()) */ egid != pc->p_svgid && /* allow setegid(saved gid) */ - (error = suser(pc->pc_ucred, &p->p_acflag))) + (error = suser_xxx(pc->pc_ucred, &p->p_acflag))) return (error); if (pc->pc_ucred->cr_groups[0] != egid) { pc->pc_ucred = crcopy(pc->pc_ucred); @@ -605,7 +605,7 @@ setgroups(p, uap) register u_int ngrp; int error; - if ((error = suser(pc->pc_ucred, &p->p_acflag))) + if ((error = suser_xxx(pc->pc_ucred, &p->p_acflag))) return (error); ngrp = uap->gidsetsize; if (ngrp > NGROUPS) @@ -654,7 +654,7 @@ setreuid(p, uap) if (((ruid != (uid_t)-1 && ruid != pc->p_ruid && ruid != pc->p_svuid) || (euid != (uid_t)-1 && euid != pc->pc_ucred->cr_uid && euid != pc->p_ruid && euid != pc->p_svuid)) && - (error = suser(pc->pc_ucred, &p->p_acflag)) != 0) + (error = suser_xxx(pc->pc_ucred, &p->p_acflag)) != 0) return (error); if (euid != (uid_t)-1 && pc->pc_ucred->cr_uid != euid) { @@ -697,7 +697,7 @@ setregid(p, uap) if (((rgid != (gid_t)-1 && rgid != pc->p_rgid && rgid != pc->p_svgid) || (egid != (gid_t)-1 && egid != pc->pc_ucred->cr_groups[0] && egid != pc->p_rgid && egid != pc->p_svgid)) && - (error = suser(pc->pc_ucred, &p->p_acflag)) != 0) + (error = suser_xxx(pc->pc_ucred, &p->p_acflag)) != 0) return (error); if (egid != (gid_t)-1 && pc->pc_ucred->cr_groups[0] != egid) { @@ -766,7 +766,14 @@ groupmember(gid, cred) * Returns 0 or error. */ int -suser(cred, acflag) +suser(p) + struct proc *p; +{ + return suser_xxx(p->p_ucred, &p->p_acflag); +} + +int +suser_xxx(cred, acflag) struct ucred *cred; u_short *acflag; { @@ -876,7 +883,7 @@ setlogin(p, uap) int error; char logintmp[MAXLOGNAME]; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); error = copyinstr((caddr_t) uap->namebuf, (caddr_t) logintmp, sizeof(logintmp), (size_t *)0); diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 14d664d..eba4ad9 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.44 1999/03/11 21:53:12 bde Exp $ + * $Id: kern_resource.c,v 1.45 1999/03/13 19:46:12 bde Exp $ */ #include "opt_compat.h" @@ -202,7 +202,7 @@ donice(curp, chgp, n) n = PRIO_MAX; if (n < PRIO_MIN) n = PRIO_MIN; - if (n < chgp->p_nice && suser(pcred->pc_ucred, &curp->p_acflag)) + if (n < chgp->p_nice && suser_xxx(pcred->pc_ucred, &curp->p_acflag)) return (EACCES); chgp->p_nice = n; (void)resetpriority(chgp); @@ -254,7 +254,7 @@ rtprio(curp, uap) pcred->p_ruid != p->p_ucred->cr_uid) return (EPERM); /* disallow setting rtprio in most cases if not superuser */ - if (suser(pcred->pc_ucred, &curp->p_acflag)) { + if (suser_xxx(pcred->pc_ucred, &curp->p_acflag)) { /* can't set someone else's */ if (uap->pid) return (EPERM); @@ -387,7 +387,7 @@ dosetrlimit(p, which, limp) if (limp->rlim_cur > alimp->rlim_max || limp->rlim_max > alimp->rlim_max) - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); if (limp->rlim_cur > limp->rlim_max) limp->rlim_cur = limp->rlim_max; diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 8eef728..b8cbaed 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_shutdown.c,v 1.45 1999/01/30 19:28:30 msmith Exp $ + * $Id: kern_shutdown.c,v 1.46 1999/01/30 19:29:10 msmith Exp $ */ #include "opt_ddb.h" @@ -145,7 +145,7 @@ reboot(p, uap) { int error; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); boot(uap->opt); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 7418800..fc0a204 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 - * $Id: kern_sysctl.c,v 1.85 1999/03/23 14:23:15 phk Exp $ + * $Id: kern_sysctl.c,v 1.86 1999/03/30 09:00:45 phk Exp $ */ #include "opt_compat.h" @@ -764,7 +764,7 @@ found: /* Most likely only root can write */ if (!(oid->oid_kind & CTLFLAG_ANYBODY) && req->newptr && req->p && - (i = suser(req->p->p_ucred, &req->p->p_acflag))) + (i = suser(req->p))) return (i); if (!oid->oid_handler) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index e6921ea..56084aa 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.63 1999/04/07 17:32:21 mjacob Exp $ + * $Id: kern_time.c,v 1.64 1999/04/07 19:48:09 nsayer Exp $ */ #include <sys/param.h> @@ -173,7 +173,7 @@ clock_settime(p, uap) struct timespec ats; int error; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); if (SCARG(uap, clock_id) != CLOCK_REALTIME) return (EINVAL); @@ -329,7 +329,7 @@ settimeofday(p, uap) struct timezone atz; int error; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); /* Verify all parameters before changing time. */ if (uap->tv) { @@ -369,7 +369,7 @@ adjtime(p, uap) register long ndelta, ntickdelta, odelta; int s, error; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); if ((error = copyin((caddr_t)uap->delta, (caddr_t)&atv, sizeof(struct timeval)))) diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index b7cb83b..42b563f 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 - * $Id: kern_xxx.c,v 1.27 1997/12/16 17:40:21 eivind Exp $ + * $Id: kern_xxx.c,v 1.28 1998/08/24 08:39:38 dfr Exp $ */ #include "opt_compat.h" @@ -85,7 +85,7 @@ osethostname(p, uap) name[0] = CTL_KERN; name[1] = KERN_HOSTNAME; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); return (userland_sysctl(p, name, 2, 0, 0, 0, uap->hostname, uap->len, 0)); @@ -122,7 +122,7 @@ osethostid(p, uap) { int error; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); hostid = uap->hostid; return (0); @@ -244,7 +244,7 @@ setdomainname(p, uap) { int error, domainnamelen; - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) return (error); if ((u_int)uap->len > sizeof (domainname) - 1) return EINVAL; diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 711132b..62e6736 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sys_process.c,v 1.42 1999/01/27 21:49:57 dillon Exp $ + * $Id: sys_process.c,v 1.43 1999/03/29 08:29:22 dfr Exp $ */ #include <sys/param.h> @@ -239,7 +239,7 @@ ptrace(curp, uap) /* not owned by you, has done setuid (unless you're root) */ if ((p->p_cred->p_ruid != curp->p_cred->p_ruid) || (p->p_flag & P_SUGID)) { - if ((error = suser(curp->p_ucred, &curp->p_acflag)) != 0) + if ((error = suser(curp)) != 0) return error; } diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c index 30bcba0..1771163 100644 --- a/sys/kern/sysv_ipc.c +++ b/sys/kern/sysv_ipc.c @@ -1,4 +1,4 @@ -/* $Id: sysv_ipc.c,v 1.8 1997/11/18 12:52:10 bde Exp $ */ +/* $Id: sysv_ipc.c,v 1.9 1999/01/30 12:21:48 phk Exp $ */ /* $NetBSD: sysv_ipc.c,v 1.7 1994/06/29 06:33:11 cgd Exp $ */ /* @@ -43,7 +43,7 @@ * Check for ipc permission * * XXX: Should pass proc argument so that we can pass - * XXX: proc->p_acflag to suser() + * XXX: proc->p_acflag to suser_xxx() */ int @@ -53,7 +53,7 @@ ipcperm(cred, perm, mode) int mode; { - if (suser(cred, (u_short *)NULL)) + if (suser_xxx(cred, (u_short *)NULL)) return (0); /* Check for user match. */ diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 334bbf4..151a843 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $Id: sysv_msg.c,v 1.19 1999/01/30 12:21:48 phk Exp $ */ +/* $Id: sysv_msg.c,v 1.20 1999/04/21 13:30:01 sada Exp $ */ /* * Implementation of SVID messages @@ -253,7 +253,7 @@ msgctl(p, uap) if ((eval = copyin(user_msqptr, &msqbuf, sizeof(msqbuf))) != 0) return(eval); if (msqbuf.msg_qbytes > msqptr->msg_qbytes) { - eval = suser(cred, &p->p_acflag); + eval = suser_xxx(cred, &p->p_acflag); if (eval) return(eval); } diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 0f3b365..e732834 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.114 1999/02/19 14:25:34 luoqi Exp $ + * $Id: tty.c,v 1.115 1999/02/19 19:34:49 luoqi Exp $ */ /*- @@ -809,7 +809,7 @@ ttioctl(tp, cmd, data, flag) ISSET(constty->t_state, TS_CONNECTED)) return (EBUSY); #ifndef UCONSOLE - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); #endif constty = tp; @@ -981,9 +981,9 @@ ttioctl(tp, cmd, data, flag) splx(s); break; case TIOCSTI: /* simulate terminal input */ - if ((flag & FREAD) == 0 && suser(p->p_ucred, &p->p_acflag)) + if ((flag & FREAD) == 0 && suser(p)) return (EPERM); - if (!isctty(p, tp) && suser(p->p_ucred, &p->p_acflag)) + if (!isctty(p, tp) && suser(p)) return (EACCES); s = spltty(); (*linesw[tp->t_line].l_rint)(*(u_char *)data, tp); @@ -1035,7 +1035,7 @@ ttioctl(tp, cmd, data, flag) } break; case TIOCSDRAINWAIT: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); tp->t_timeout = *(int *)data * hz; diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 581ff3f..b565d5c 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_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/kern/tty_pty.c b/sys/kern/tty_pty.c index 36afd3b..d8b4893 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 - * $Id: tty_pty.c,v 1.54 1998/08/23 08:26:42 bde Exp $ + * $Id: tty_pty.c,v 1.55 1999/01/30 12:17:37 phk Exp $ */ /* @@ -183,7 +183,7 @@ ptsopen(dev, flag, devtype, p) tp->t_lflag = TTYDEF_LFLAG; tp->t_cflag = TTYDEF_CFLAG; tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; - } 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 (tp->t_oproc) /* Ctrlr still around. */ (void)(*linesw[tp->t_line].l_modem)(tp, 1); diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c index 686aa27..0a1438d 100644 --- a/sys/kern/tty_snoop.c +++ b/sys/kern/tty_snoop.c @@ -291,7 +291,7 @@ snpopen(dev, flag, mode, p) struct snoop *snp; register int unit, error; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); if ((unit = minor(dev)) >= NSNP) diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index e2c75c0..43c0bcc 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.120 1999/03/03 02:35:51 julian Exp $ + * $Id: vfs_syscalls.c,v 1.121 1999/03/23 14:26:40 phk Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -119,20 +119,20 @@ mount(p, uap) struct nameidata nd; char fstypename[MFSNAMELEN]; - if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag))) + if (usermount == 0 && (error = suser(p))) return (error); /* * Do not allow NFS export by non-root users. */ if (SCARG(uap, flags) & MNT_EXPORTED) { - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); } /* * Silently enforce MNT_NOSUID and MNT_NODEV for non-root users */ - if (suser(p->p_ucred, (u_short *)NULL)) + if (suser_xxx(p->p_ucred, (u_short *)NULL)) SCARG(uap, flags) |= MNT_NOSUID | MNT_NODEV; /* * Get vnode to be covered @@ -166,7 +166,7 @@ mount(p, uap) * permitted to update it. */ if (mp->mnt_stat.f_owner != p->p_ucred->cr_uid && - (error = suser(p->p_ucred, &p->p_acflag))) { + (error = suser(p))) { vput(vp); return (error); } @@ -183,7 +183,7 @@ mount(p, uap) */ if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)) || (va.va_uid != p->p_ucred->cr_uid && - (error = suser(p->p_ucred, &p->p_acflag)))) { + (error = suser(p)))) { vput(vp); return (error); } @@ -227,7 +227,7 @@ mount(p, uap) return EPERM; } /* Only load modules for root (very important!) */ - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) { + if ((error = suser(p)) != 0) { vput(vp); return error; } @@ -426,7 +426,7 @@ unmount(p, uap) * permitted to unmount this filesystem. */ if ((mp->mnt_stat.f_owner != p->p_ucred->cr_uid) && - (error = suser(p->p_ucred, &p->p_acflag))) { + (error = suser(p))) { vput(vp); return (error); } @@ -631,7 +631,7 @@ statfs(p, uap) if (error) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - if (suser(p->p_ucred, (u_short *)NULL)) { + if (suser_xxx(p->p_ucred, (u_short *)NULL)) { bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb)); sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; @@ -671,7 +671,7 @@ fstatfs(p, uap) if (error) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - if (suser(p->p_ucred, (u_short *)NULL)) { + if (suser_xxx(p->p_ucred, (u_short *)NULL)) { bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb)); sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; @@ -886,7 +886,7 @@ chroot(p, uap) int error; struct nameidata nd; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); if (chroot_allow_open_directories == 0 || @@ -1076,7 +1076,7 @@ mknod(p, uap) int whiteout = 0; struct nameidata nd; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p); @@ -2977,7 +2977,7 @@ revoke(p, uap) if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && - (error = suser(p->p_ucred, &p->p_acflag))) + (error = suser(p))) goto out; if (vp->v_usecount > 1 || (vp->v_flag & VALIASED)) VOP_REVOKE(vp, REVOKEALL); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index e2c75c0..43c0bcc 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.120 1999/03/03 02:35:51 julian Exp $ + * $Id: vfs_syscalls.c,v 1.121 1999/03/23 14:26:40 phk Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -119,20 +119,20 @@ mount(p, uap) struct nameidata nd; char fstypename[MFSNAMELEN]; - if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag))) + if (usermount == 0 && (error = suser(p))) return (error); /* * Do not allow NFS export by non-root users. */ if (SCARG(uap, flags) & MNT_EXPORTED) { - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); } /* * Silently enforce MNT_NOSUID and MNT_NODEV for non-root users */ - if (suser(p->p_ucred, (u_short *)NULL)) + if (suser_xxx(p->p_ucred, (u_short *)NULL)) SCARG(uap, flags) |= MNT_NOSUID | MNT_NODEV; /* * Get vnode to be covered @@ -166,7 +166,7 @@ mount(p, uap) * permitted to update it. */ if (mp->mnt_stat.f_owner != p->p_ucred->cr_uid && - (error = suser(p->p_ucred, &p->p_acflag))) { + (error = suser(p))) { vput(vp); return (error); } @@ -183,7 +183,7 @@ mount(p, uap) */ if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)) || (va.va_uid != p->p_ucred->cr_uid && - (error = suser(p->p_ucred, &p->p_acflag)))) { + (error = suser(p)))) { vput(vp); return (error); } @@ -227,7 +227,7 @@ mount(p, uap) return EPERM; } /* Only load modules for root (very important!) */ - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) { + if ((error = suser(p)) != 0) { vput(vp); return error; } @@ -426,7 +426,7 @@ unmount(p, uap) * permitted to unmount this filesystem. */ if ((mp->mnt_stat.f_owner != p->p_ucred->cr_uid) && - (error = suser(p->p_ucred, &p->p_acflag))) { + (error = suser(p))) { vput(vp); return (error); } @@ -631,7 +631,7 @@ statfs(p, uap) if (error) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - if (suser(p->p_ucred, (u_short *)NULL)) { + if (suser_xxx(p->p_ucred, (u_short *)NULL)) { bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb)); sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; @@ -671,7 +671,7 @@ fstatfs(p, uap) if (error) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - if (suser(p->p_ucred, (u_short *)NULL)) { + if (suser_xxx(p->p_ucred, (u_short *)NULL)) { bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb)); sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; @@ -886,7 +886,7 @@ chroot(p, uap) int error; struct nameidata nd; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); if (chroot_allow_open_directories == 0 || @@ -1076,7 +1076,7 @@ mknod(p, uap) int whiteout = 0; struct nameidata nd; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, SCARG(uap, path), p); @@ -2977,7 +2977,7 @@ revoke(p, uap) if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && - (error = suser(p->p_ucred, &p->p_acflag))) + (error = suser(p))) goto out; if (vp->v_usecount > 1 || (vp->v_flag & VALIASED)) VOP_REVOKE(vp, REVOKEALL); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 7a33aae..802c437 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 - * $Id: vfs_vnops.c,v 1.65 1999/04/04 21:41:17 dt Exp $ + * $Id: vfs_vnops.c,v 1.66 1999/04/21 05:56:45 alc Exp $ */ #include <sys/param.h> @@ -422,7 +422,7 @@ vn_stat(vp, sb, p) sb->st_ctimespec = vap->va_ctime; sb->st_blksize = vap->va_blocksize; sb->st_flags = vap->va_flags; - if (suser(p->p_ucred, (u_short *)NULL)) + if (suser_xxx(p->p_ucred, (u_short *)NULL)) sb->st_gen = 0; else sb->st_gen = vap->va_gen; diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index e6df829..64387e6 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vnops.c,v 1.69 1999/01/28 00:57:49 dillon Exp $ + * $Id: devfs_vnops.c,v 1.70 1999/02/25 16:06:51 bde Exp $ */ @@ -378,10 +378,10 @@ found: return (0); /* * Root gets to do anything. - * but only use suser prives as a last resort + * but only use suser_xxx prives as a last resort * (Use of super powers is recorded in ap->a_p->p_acflag) */ - if( suser(cred, &ap->a_p->p_acflag) == 0) /* XXX what if no proc? */ + if( suser_xxx(cred, &ap->a_p->p_acflag) == 0) /* XXX what if no proc? */ return 0; return (EACCES); } @@ -519,7 +519,7 @@ DBPRINT(("setattr\n")); #endif if (((vap->va_vaflags & VA_UTIMES_NULL) == 0) && (cred->cr_uid != file_node->uid) && - suser(cred, &p->p_acflag)) + suser_xxx(cred, &p->p_acflag)) return (EPERM); if(VOP_ACCESS(vp, VWRITE, cred, p)) return (EACCES); @@ -534,7 +534,7 @@ DBPRINT(("setattr\n")); */ if (vap->va_mode != (u_short)VNOVAL) { if ((cred->cr_uid != file_node->uid) - && suser(cred, &p->p_acflag)) + && suser_xxx(cred, &p->p_acflag)) return (EPERM); /* set drwxwxrwx stuff */ file_node->mode &= ~07777; @@ -545,7 +545,7 @@ DBPRINT(("setattr\n")); * Change the owner.. must be root to do this. */ if (vap->va_uid != (uid_t)VNOVAL) { - if (suser(cred, &p->p_acflag)) + if (suser_xxx(cred, &p->p_acflag)) return (EPERM); file_node->uid = vap->va_uid; } @@ -553,8 +553,8 @@ DBPRINT(("setattr\n")); /* * Change the group.. must be root or owner to do this. * If we are the owner, we must be in the target group too. - * don't use suser() unless you have to as it reports - * whether you needed suser powers or not. + * don't use suser_xxx() unless you have to as it reports + * whether you needed suser_xxx powers or not. */ if (vap->va_gid != (gid_t)VNOVAL) { if (cred->cr_uid == file_node->uid){ @@ -568,7 +568,7 @@ DBPRINT(("setattr\n")); * we can't do it with normal privs, * do we have an ace up our sleeve? */ - if( suser(cred, &p->p_acflag)) + if( suser_xxx(cred, &p->p_acflag)) return (EPERM); cando: file_node->gid = vap->va_gid; @@ -580,7 +580,7 @@ cando: * flags should be handled some day */ if (vap->va_flags != VNOVAL) { - if (error = suser(cred, &p->p_acflag)) + if (error = suser_xxx(cred, &p->p_acflag)) return error; if (cred->cr_uid == 0) ; diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 619e1b2..180a47f 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -37,7 +37,7 @@ * @(#)procfs.h 8.9 (Berkeley) 5/14/95 * * From: - * $Id: procfs.h,v 1.20 1998/07/07 04:08:44 bde Exp $ + * $Id: procfs.h,v 1.21 1999/01/05 03:53:06 peter Exp $ */ /* @@ -95,8 +95,7 @@ struct pfsnode { ((((p1)->p_cred->pc_ucred->cr_uid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_ruid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_svuid == (p2)->p_cred->p_ruid) && \ - ((p2)->p_flag & P_SUGID) == 0) || \ - (suser((p1)->p_cred->pc_ucred, &(p1)->p_acflag) == 0)) + ((p2)->p_flag & P_SUGID) == 0) || (suser((p1)) == 0)) /* * Format of a directory entry in /proc, ... diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index 22d8f74..4ca115f 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -37,7 +37,7 @@ * * @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 * - * $Id: procfs_mem.c,v 1.34 1998/07/15 02:32:19 bde Exp $ + * $Id: procfs_mem.c,v 1.35 1998/10/28 13:37:00 dg Exp $ */ /* @@ -331,7 +331,7 @@ int procfs_kmemaccess(curp) struct ucred *cred; cred = curp->p_cred->pc_ucred; - if (suser(cred, &curp->p_acflag)) + if (suser_xxx(cred, &curp->p_acflag)) return 1; for (i = 0; i < cred->cr_ngroups; i++) diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 1aa5453..ffab3e8 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.63 1999/01/05 03:53:06 peter Exp $ + * $Id: procfs_vnops.c,v 1.64 1999/01/27 22:42:07 dillon Exp $ */ /* @@ -246,12 +246,12 @@ procfs_ioctl(ap) break; case PIOCSFL: /* - * NFLAGS is "non-suser flags" -- currently, only + * NFLAGS is "non-suser_xxx flags" -- currently, only * PFS_ISUGID ("ignore set u/g id"); */ #define NFLAGS (PF_ISUGID) flags = (unsigned char)*(unsigned int*)ap->a_data; - if (flags & NFLAGS && (error = suser(p->p_ucred, &p->p_acflag))) + if (flags & NFLAGS && (error = suser(p))) return error; procp->p_pfsflags = flags; break; diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c index 3ad41cf..3acc700 100644 --- a/sys/miscfs/umapfs/umap_vfsops.c +++ b/sys/miscfs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $Id: umap_vfsops.c,v 1.23 1998/09/07 13:17:01 bde Exp $ + * $Id: umap_vfsops.c,v 1.24 1999/03/12 19:40:39 imp Exp $ */ /* @@ -98,7 +98,7 @@ umapfs_mount(mp, path, data, ndp, p) /* * Only for root */ - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); #ifdef UMAPFS_DIAGNOSTIC diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 36aa91d..00f576b 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.80 1998/12/07 21:58:35 archie Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.81 1999/01/27 22:42:09 dillon Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -431,7 +431,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return (error); /* * We are very inconsistent about handling unsupported @@ -472,7 +472,7 @@ msdosfs_setattr(ap) gid = pmp->pm_gid; if ((cred->cr_uid != pmp->pm_uid || uid != pmp->pm_uid || (gid != pmp->pm_gid && !groupmember(gid, cred))) && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return error; if (uid != pmp->pm_uid || gid != pmp->pm_gid) return EINVAL; @@ -504,7 +504,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag)) && + (error = suser_xxx(cred, &ap->a_p->p_acflag)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_p)))) return (error); @@ -527,7 +527,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return (error); if (vp->v_type != VDIR) { /* We ignore the read and execute bits. */ diff --git a/sys/net/if.c b/sys/net/if.c index 62a62af..bb36fa4 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.67 1999/04/16 21:22:44 peter Exp $ + * $Id: if.c,v 1.68 1999/04/26 09:02:40 peter Exp $ */ #include "opt_compat.h" @@ -635,7 +635,7 @@ ifioctl(so, cmd, data, p) break; case SIOCSIFFLAGS: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); ifr->ifr_prevflags = ifp->if_flags; @@ -657,7 +657,7 @@ ifioctl(so, cmd, data, p) break; case SIOCSIFMETRIC: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); ifp->if_metric = ifr->ifr_metric; @@ -665,7 +665,7 @@ ifioctl(so, cmd, data, p) break; case SIOCSIFPHYS: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return error; if (!ifp->if_ioctl) @@ -676,7 +676,7 @@ ifioctl(so, cmd, data, p) return(error); case SIOCSIFMTU: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); if (ifp->if_ioctl == NULL) @@ -694,7 +694,7 @@ ifioctl(so, cmd, data, p) case SIOCADDMULTI: case SIOCDELMULTI: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); @@ -718,7 +718,7 @@ ifioctl(so, cmd, data, p) case SIOCSIFMEDIA: case SIOCSIFGENERIC: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); if (ifp->if_ioctl == 0) diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 6068f47..c552a41 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.58 1998/06/07 17:12:03 dfr Exp $ */ +/* $Id: if_ppp.c,v 1.59 1998/06/20 16:28:01 peter Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */ @@ -377,7 +377,7 @@ pppioctl(sc, cmd, data, flag, p) break; case PPPIOCSFLAGS: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); flags = *(int *)data & SC_MASK; s = splsoftnet(); @@ -391,7 +391,7 @@ pppioctl(sc, cmd, data, flag, p) break; case PPPIOCSMRU: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); mru = *(int *)data; if (mru >= PPP_MRU && mru <= PPP_MAXMRU) @@ -404,7 +404,7 @@ pppioctl(sc, cmd, data, flag, p) #ifdef VJC case PPPIOCSMAXCID: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); if (sc->sc_comp) { s = splsoftnet(); @@ -415,14 +415,14 @@ pppioctl(sc, cmd, data, flag, p) #endif case PPPIOCXFERUNIT: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); sc->sc_xfer = p->p_pid; break; #ifdef PPP_COMPRESS case PPPIOCSCOMPRESS: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); odp = (struct ppp_option_data *) data; nb = odp->length; @@ -492,7 +492,7 @@ pppioctl(sc, cmd, data, flag, p) if (cmd == PPPIOCGNPMODE) { npi->mode = sc->sc_npmode[npx]; } else { - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); if (npi->mode != sc->sc_npmode[npx]) { s = splsoftnet(); @@ -613,7 +613,7 @@ pppsioctl(ifp, cmd, data) break; case SIOCSIFMTU: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) break; if (ifr->ifr_mtu > PPP_MAXMTU) error = EINVAL; diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 8667b06..d5ef37b 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $Id: if_sl.c,v 1.72 1999/01/27 22:42:14 dillon Exp $ + * $Id: if_sl.c,v 1.73 1999/02/02 00:28:29 dillon Exp $ */ /* @@ -274,7 +274,7 @@ slopen(dev, tp) register int nsl; int s, error; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index e9725bc..92c156d 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -150,7 +150,7 @@ tunopen(dev, flag, mode, p) struct tun_softc *tp; register int unit, error; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 74e7172..7f91fda 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -70,7 +70,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: ppp_tty.c,v 1.37 1998/06/20 16:39:35 peter Exp $ */ +/* $Id: ppp_tty.c,v 1.38 1999/01/17 20:53:47 peter Exp $ */ #include "ppp.h" #if NPPP > 0 @@ -203,7 +203,7 @@ pppopen(dev, tp) register struct ppp_softc *sc; int error, s; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); s = spltty(); @@ -472,7 +472,7 @@ ppptioctl(tp, cmd, data, flag, p) error = 0; switch (cmd) { case PPPIOCSASYNCMAP: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) break; sc->sc_asyncmap[0] = *(u_int *)data; break; @@ -482,7 +482,7 @@ ppptioctl(tp, cmd, data, flag, p) break; case PPPIOCSRASYNCMAP: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) break; sc->sc_rasyncmap = *(u_int *)data; break; @@ -492,7 +492,7 @@ ppptioctl(tp, cmd, data, flag, p) break; case PPPIOCSXASYNCMAP: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) break; s = spltty(); bcopy(data, sc->sc_asyncmap, sizeof(sc->sc_asyncmap)); diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index 348bb85..109c942 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: raw_usrreq.c,v 1.15 1997/09/14 03:10:38 peter Exp $ + * $Id: raw_usrreq.c,v 1.16 1997/11/07 08:53:18 phk Exp $ */ #include <sys/param.h> @@ -158,7 +158,7 @@ raw_uattach(struct socket *so, int proto, struct proc *p) if (rp == 0) return EINVAL; - if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p && (error = suser(p)) != 0) return error; return raw_attach(so, proto); } diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c index 7900fe5..9f54cb7 100644 --- a/sys/netatalk/at_control.c +++ b/sys/netatalk/at_control.c @@ -98,7 +98,7 @@ at_control(struct socket *so, u_long cmd, caddr_t data, /* * If we are not superuser, then we don't get to do these ops. */ - if ( suser(p->p_ucred, &p->p_acflag) ) { + if ( suser(p) ) { return( EPERM ); } diff --git a/sys/netatalk/ddp_pcb.c b/sys/netatalk/ddp_pcb.c index 6253821..d35fcdf 100644 --- a/sys/netatalk/ddp_pcb.c +++ b/sys/netatalk/ddp_pcb.c @@ -252,7 +252,7 @@ at_pcbsetaddr(struct ddpcb *ddp, struct sockaddr *addr, struct proc *p) return( EINVAL ); } if ( sat->sat_port < ATPORT_RESERVED && - suser( p->p_ucred, &p->p_acflag ) ) { + suser_xxx( p->p_ucred, &p->p_acflag ) ) { return( EACCES ); } } diff --git a/sys/netatalk/ddp_usrreq.c b/sys/netatalk/ddp_usrreq.c index 6253821..d35fcdf 100644 --- a/sys/netatalk/ddp_usrreq.c +++ b/sys/netatalk/ddp_usrreq.c @@ -252,7 +252,7 @@ at_pcbsetaddr(struct ddpcb *ddp, struct sockaddr *addr, struct proc *p) return( EINVAL ); } if ( sat->sat_port < ATPORT_RESERVED && - suser( p->p_ucred, &p->p_acflag ) ) { + suser_xxx( p->p_ucred, &p->p_acflag ) ) { return( EACCES ); } } diff --git a/sys/netatm/atm_usrreq.c b/sys/netatm/atm_usrreq.c index 00a4e38..2dd968e 100644 --- a/sys/netatm/atm_usrreq.c +++ b/sys/netatm/atm_usrreq.c @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $Id: atm_usrreq.c,v 1.3 1999/01/19 23:16:10 mks Exp $ + * @(#) $Id: atm_usrreq.c,v 1.4 1999/01/27 22:42:20 dillon Exp $ * */ @@ -38,7 +38,7 @@ #include <netatm/kern_include.h> #ifndef lint -__RCSID("@(#) $Id: atm_usrreq.c,v 1.3 1999/01/19 23:16:10 mks Exp $"); +__RCSID("@(#) $Id: atm_usrreq.c,v 1.4 1999/01/27 22:42:20 dillon Exp $"); #endif @@ -175,7 +175,7 @@ atm_dgram_control(so, cmd, data, ifp, p) struct atmcfgreq *acp = (struct atmcfgreq *)data; struct atm_pif *pip; - if (p && (suser(p->p_ucred, &p->p_acflag) != 0)) + if (p && (suser(p) != 0)) ATM_RETERR(EPERM); switch (acp->acr_opcode) { @@ -208,7 +208,7 @@ atm_dgram_control(so, cmd, data, ifp, p) struct atmaddreq *aap = (struct atmaddreq *)data; Atm_endpoint *epp; - if (p && (suser(p->p_ucred, &p->p_acflag) != 0)) + if (p && (suser(p) != 0)) ATM_RETERR(EPERM); switch (aap->aar_opcode) { @@ -258,7 +258,7 @@ atm_dgram_control(so, cmd, data, ifp, p) struct sigmgr *smp; Atm_endpoint *epp; - if (p && (suser(p->p_ucred, &p->p_acflag) != 0)) + if (p && (suser(p) != 0)) ATM_RETERR(EPERM); switch (adp->adr_opcode) { @@ -311,7 +311,7 @@ atm_dgram_control(so, cmd, data, ifp, p) struct sigmgr *smp; struct ifnet *ifp2; - if (p && (suser(p->p_ucred, &p->p_acflag) != 0)) + if (p && (suser(p) != 0)) ATM_RETERR(EPERM); switch (asp->asr_opcode) { diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 0d0dbe9..0c78b99 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in.c 8.4 (Berkeley) 1/9/95 - * $Id: in.c,v 1.39 1998/12/07 05:41:10 eivind Exp $ + * $Id: in.c,v 1.40 1999/04/24 12:28:51 luigi Exp $ */ #include <sys/param.h> @@ -201,7 +201,7 @@ in_control(so, cmd, data, ifp, p) case SIOCSIFADDR: case SIOCSIFNETMASK: case SIOCSIFDSTADDR: - if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p && (error = suser(p)) != 0) return error; if (ifp == 0) @@ -238,7 +238,7 @@ in_control(so, cmd, data, ifp, p) break; case SIOCSIFBRDADDR: - if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p && (error = suser(p)) != 0) return error; /* FALLTHROUGH */ diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index cdd5a60..7788c9b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 - * $Id: in_pcb.c,v 1.46 1998/12/07 21:58:37 archie Exp $ + * $Id: in_pcb.c,v 1.47 1999/01/27 22:42:24 dillon Exp $ */ #include <sys/param.h> @@ -195,7 +195,7 @@ in_pcbbind(inp, nam, p) /* GROSS */ if (ntohs(lport) < IPPORT_RESERVED && p && - suser(p->p_ucred, &p->p_acflag)) + suser(p)) return (EACCES); if (so->so_uid && !IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { @@ -227,7 +227,7 @@ in_pcbbind(inp, nam, p) last = ipport_hilastauto; lastport = &pcbinfo->lasthi; } else if (inp->inp_flags & INP_LOWPORT) { - if (p && (error = suser(p->p_ucred, &p->p_acflag))) + if (p && (error = suser(p))) return error; first = ipport_lowfirstauto; /* 1023 */ last = ipport_lowlastauto; /* 600 */ diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 5cf0ecb..e4b82b9 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ip_divert.c,v 1.36 1999/02/08 05:48:46 julian Exp $ + * $Id: ip_divert.c,v 1.37 1999/02/08 05:53:39 julian Exp $ */ #include "opt_inet.h" @@ -352,7 +352,7 @@ div_attach(struct socket *so, int proto, struct proc *p) inp = sotoinpcb(so); if (inp) panic("div_attach"); - if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p && (error = suser(p)) != 0) return error; s = splnet(); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 57da1d3..571491d 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ip.c,v 1.56 1998/12/14 18:09:13 luigi Exp $ + * $Id: raw_ip.c,v 1.57 1999/04/20 13:32:06 peter Exp $ */ #include <sys/param.h> @@ -427,7 +427,7 @@ rip_attach(struct socket *so, int proto, struct proc *p) inp = sotoinpcb(so); if (inp) panic("rip_attach"); - if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p && (error = suser(p)) != 0) return error; s = splnet(); diff --git a/sys/netipx/ipx.c b/sys/netipx/ipx.c index 59ccffe..f23759c 100644 --- a/sys/netipx/ipx.c +++ b/sys/netipx/ipx.c @@ -33,7 +33,7 @@ * * @(#)ipx.c * - * $Id: ipx.c,v 1.13 1998/12/04 22:54:54 archie Exp $ + * $Id: ipx.c,v 1.15 1998/12/09 13:48:08 eivind Exp $ */ #include <sys/param.h> @@ -109,7 +109,7 @@ ipx_control(so, cmd, data, ifp, p) return (0); } - if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p && (error = suser(p)) != 0) return (error); switch (cmd) { diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c index fa2d357..7a55c87 100644 --- a/sys/netipx/ipx_pcb.c +++ b/sys/netipx/ipx_pcb.c @@ -33,7 +33,7 @@ * * @(#)ipx_pcb.c * - * $Id: ipx_pcb.c,v 1.14 1998/02/09 06:10:23 eivind Exp $ + * $Id: ipx_pcb.c,v 1.15 1999/02/06 10:48:10 jhay Exp $ */ #include <sys/param.h> @@ -99,7 +99,7 @@ ipx_pcbbind(ipxp, nam, p) int error; if (aport < IPXPORT_RESERVED && - p != NULL && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + p != NULL && (error = suser(p)) != 0) return (error); if (ipx_pcblookup(&zeroipx_addr, lport, 0)) return (EADDRINUSE); diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index 25806aa..8106ecc 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -33,7 +33,7 @@ * * @(#)ipx_usrreq.c * - * $Id: ipx_usrreq.c,v 1.21 1998/12/07 21:58:42 archie Exp $ + * $Id: ipx_usrreq.c,v 1.22 1999/02/06 10:48:11 jhay Exp $ */ #include "opt_ipx.h" @@ -598,7 +598,7 @@ ripx_attach(so, proto, p) int s; struct ipxpcb *ipxp = sotoipxpcb(so); - if (p != NULL && (error = suser(p->p_ucred, &p->p_acflag)) != 0) + if (p != NULL && (error = suser(p)) != 0) return (error); s = splnet(); error = ipx_pcballoc(so, &ipxrawpcb, p); diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index cb6f0e8..d60f265 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95 - * $Id: nfs_serv.c,v 1.72 1998/12/09 15:12:53 eivind Exp $ + * $Id: nfs_serv.c,v 1.73 1999/02/16 10:49:53 dfr Exp $ */ /* @@ -1445,7 +1445,7 @@ nfsrv_create(nfsd, slp, procp, mrq) if (vap->va_type == VCHR && rdev == 0xffffffff) vap->va_type = VFIFO; if (vap->va_type != VFIFO && - (error = suser(cred, (u_short *)0))) { + (error = suser_xxx(cred, (u_short *)0))) { vrele(nd.ni_startdir); zfree(namei_zone, nd.ni_cnd.cn_pnbuf); VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); @@ -1642,7 +1642,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq) if (!error) zfree(namei_zone, nd.ni_cnd.cn_pnbuf); } else { - if (vtyp != VFIFO && (error = suser(cred, (u_short *)0))) { + if (vtyp != VFIFO && (error = suser_xxx(cred, (u_short *)0))) { vrele(nd.ni_startdir); zfree(namei_zone, nd.ni_cnd.cn_pnbuf); VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 38b5af2..d3d07c6 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_syscalls.c,v 1.47 1999/02/18 09:19:41 dfr Exp $ + * $Id: nfs_syscalls.c,v 1.48 1999/02/25 00:03:51 peter Exp $ */ #include <sys/param.h> @@ -145,7 +145,7 @@ getfh(p, uap) /* * Must be super user */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if(error) return (error); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->fname, p); @@ -199,7 +199,7 @@ nfssvc(p, uap) /* * Must be super user */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if(error) return (error); while (nfssvc_sockhead_flag & SLP_INIT) { diff --git a/sys/nfsclient/nfs_nfsiod.c b/sys/nfsclient/nfs_nfsiod.c index 38b5af2..d3d07c6 100644 --- a/sys/nfsclient/nfs_nfsiod.c +++ b/sys/nfsclient/nfs_nfsiod.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_syscalls.c,v 1.47 1999/02/18 09:19:41 dfr Exp $ + * $Id: nfs_syscalls.c,v 1.48 1999/02/25 00:03:51 peter Exp $ */ #include <sys/param.h> @@ -145,7 +145,7 @@ getfh(p, uap) /* * Must be super user */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if(error) return (error); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->fname, p); @@ -199,7 +199,7 @@ nfssvc(p, uap) /* * Must be super user */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if(error) return (error); while (nfssvc_sockhead_flag & SLP_INIT) { diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index cb6f0e8..d60f265 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95 - * $Id: nfs_serv.c,v 1.72 1998/12/09 15:12:53 eivind Exp $ + * $Id: nfs_serv.c,v 1.73 1999/02/16 10:49:53 dfr Exp $ */ /* @@ -1445,7 +1445,7 @@ nfsrv_create(nfsd, slp, procp, mrq) if (vap->va_type == VCHR && rdev == 0xffffffff) vap->va_type = VFIFO; if (vap->va_type != VFIFO && - (error = suser(cred, (u_short *)0))) { + (error = suser_xxx(cred, (u_short *)0))) { vrele(nd.ni_startdir); zfree(namei_zone, nd.ni_cnd.cn_pnbuf); VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); @@ -1642,7 +1642,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq) if (!error) zfree(namei_zone, nd.ni_cnd.cn_pnbuf); } else { - if (vtyp != VFIFO && (error = suser(cred, (u_short *)0))) { + if (vtyp != VFIFO && (error = suser_xxx(cred, (u_short *)0))) { vrele(nd.ni_startdir); zfree(namei_zone, nd.ni_cnd.cn_pnbuf); VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index 38b5af2..d3d07c6 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_syscalls.c,v 1.47 1999/02/18 09:19:41 dfr Exp $ + * $Id: nfs_syscalls.c,v 1.48 1999/02/25 00:03:51 peter Exp $ */ #include <sys/param.h> @@ -145,7 +145,7 @@ getfh(p, uap) /* * Must be super user */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if(error) return (error); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->fname, p); @@ -199,7 +199,7 @@ nfssvc(p, uap) /* * Must be super user */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if(error) return (error); while (nfssvc_sockhead_flag & SLP_INIT) { diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index 7d6c8bb..5a5d338 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.53 1999/04/06 03:12:22 peter Exp $ + * $Id: fd.c,v 1.54 1999/04/18 14:42:16 kato Exp $ * */ @@ -2717,7 +2717,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/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index 1a788ed..8dec5d7 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.87 1999/04/19 11:11:01 kato Exp $ + * $Id: sio.c,v 1.88 1999/04/19 16:10:40 kato Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -1941,7 +1941,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -2868,7 +2868,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; @@ -2961,7 +2961,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); @@ -3028,7 +3028,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/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index 7d6c8bb..5a5d338 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.53 1999/04/06 03:12:22 peter Exp $ + * $Id: fd.c,v 1.54 1999/04/18 14:42:16 kato Exp $ * */ @@ -2717,7 +2717,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/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index 1a788ed..8dec5d7 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.87 1999/04/19 11:11:01 kato Exp $ + * $Id: sio.c,v 1.88 1999/04/19 16:10:40 kato Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -1941,7 +1941,7 @@ open_top: } } if (tp->t_state & TS_XCLUDE && - suser(p->p_ucred, &p->p_acflag)) { + suser(p)) { error = EBUSY; goto out; } @@ -2868,7 +2868,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; @@ -2961,7 +2961,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); @@ -3028,7 +3028,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/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c index 98bb1db..5c9d7e3 100644 --- a/sys/pc98/pc98/syscons.c +++ b/sys/pc98/pc98/syscons.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: syscons.c,v 1.115 1999/04/04 02:53:08 kato Exp $ + * $Id: syscons.c,v 1.116 1999/04/18 14:42:18 kato Exp $ */ #include "sc.h" @@ -768,7 +768,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) mouse_level = 0; /* XXX */ } else - if (tp->t_state & TS_XCLUDE && suser(p->p_ucred, &p->p_acflag)) + if (tp->t_state & TS_XCLUDE && suser(p)) return(EBUSY); if (minor(dev) < MAXCONS && !console[minor(dev)]) { console[minor(dev)] = alloc_scp(); @@ -1604,7 +1604,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) return 0; case KDENABIO: /* allow io operations */ - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error != 0) return error; if (securelevel > 0) diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c index 138323e..e8f7add 100644 --- a/sys/pc98/pc98/wd_cd.c +++ b/sys/pc98/pc98/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/pc98/pc98/wfd.c b/sys/pc98/pc98/wfd.c index f2fb145..6f42292 100644 --- a/sys/pc98/pc98/wfd.c +++ b/sys/pc98/pc98/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/pccard/pccard.c b/sys/pccard/pccard.c index 7d416a9..ba870f0 100644 --- a/sys/pccard/pccard.c +++ b/sys/pccard/pccard.c @@ -28,7 +28,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: pccard.c,v 1.72 1999/02/14 20:41:01 guido Exp $ + * $Id: pccard.c,v 1.73 1999/03/10 15:00:54 roger Exp $ */ #include "opt_devfs.h" @@ -942,7 +942,7 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p) * At the very least, we only allow root to set the context. */ case PIOCSMEM: - if (suser(p->p_ucred, &p->p_acflag)) + if (suser(p)) return(EPERM); if (slt->state != filled) return(ENXIO); @@ -967,7 +967,7 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p) * Set I/O port context. */ case PIOCSIO: - if (suser(p->p_ucred, &p->p_acflag)) + if (suser(p)) return(EPERM); if (slt->state != filled) return(ENXIO); @@ -992,7 +992,7 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p) *(unsigned long *)data = pccard_mem; break; } - if (suser(p->p_ucred, &p->p_acflag)) + if (suser(p)) return(EPERM); /* * Validate the memory by checking it against the I/O @@ -1020,7 +1020,7 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p) * Allocate a driver to this slot. */ case PIOCSDRV: - if (suser(p->p_ucred, &p->p_acflag)) + if (suser(p)) return(EPERM); err = allocate_driver(slt, (struct dev_desc *)data); if (!err) diff --git a/sys/svr4/svr4_fcntl.c b/sys/svr4/svr4_fcntl.c index 9bd403c..b6e9b9a 100644 --- a/sys/svr4/svr4_fcntl.c +++ b/sys/svr4/svr4_fcntl.c @@ -275,7 +275,7 @@ fd_revoke(p, fd) goto out; if (p->p_ucred->cr_uid != vattr.va_uid && - (error = suser(p->p_ucred, &p->p_acflag)) != 0) + (error = suser(p)) != 0) goto out; if (vp->v_usecount > 1 || (vp->v_flag & VALIASED)) diff --git a/sys/svr4/svr4_misc.c b/sys/svr4/svr4_misc.c index 1d0065f..262fd06 100644 --- a/sys/svr4/svr4_misc.c +++ b/sys/svr4/svr4_misc.c @@ -560,7 +560,7 @@ svr4_sys_fchroot(p, uap) struct file *fp; int error; - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) return error; diff --git a/sys/svr4/svr4_stat.c b/sys/svr4/svr4_stat.c index 99448ba..31cf8f0 100644 --- a/sys/svr4/svr4_stat.c +++ b/sys/svr4/svr4_stat.c @@ -587,13 +587,13 @@ svr4_sys_systeminfo(p, uap) break; #if defined(WHY_DOES_AN_EMULATOR_WANT_TO_SET_HOSTNAMES) case SVR4_SI_SET_HOSTNAME: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; name = KERN_HOSTNAME; return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, p); case SVR4_SI_SET_SRPC_DOMAIN: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return error; name = KERN_NISDOMAINNAME; return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, p); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 1195526..71271fb 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)proc.h 8.15 (Berkeley) 5/19/95 - * $Id: proc.h,v 1.77 1999/04/13 19:17:13 peter Exp $ + * $Id: proc.h,v 1.78 1999/04/23 20:22:42 dt Exp $ */ #ifndef _SYS_PROC_H_ @@ -369,6 +369,7 @@ int roundrobin_interval __P((void)); void setrunnable __P((struct proc *)); void setrunqueue __P((struct proc *)); void sleepinit __P((void)); +int suser __P((struct proc *)); void remrq __P((struct proc *)); void cpu_switch __P((struct proc *)); void unsleep __P((struct proc *)); diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index e0ae96c..d95b0d8 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ucred.h 8.4 (Berkeley) 1/9/95 - * $Id: ucred.h,v 1.9 1999/01/30 12:28:49 phk Exp $ + * $Id: ucred.h,v 1.10 1999/01/31 10:05:59 bde Exp $ */ #ifndef _SYS_UCRED_H_ @@ -41,7 +41,7 @@ * Credentials. * * Please do not inspect cr_uid directly to determine superuserness. - * Only the suser() function should be used for this. + * Only the suser_xxx() function should be used for this. */ struct ucred { u_short cr_ref; /* reference count */ @@ -60,7 +60,7 @@ struct ucred *crcopy __P((struct ucred *cr)); struct ucred *crdup __P((struct ucred *cr)); void crfree __P((struct ucred *cr)); struct ucred *crget __P((void)); -int suser __P((struct ucred *cred, u_short *acflag)); +int suser_xxx __P((struct ucred *cred, u_short *acflag)); int groupmember __P((gid_t gid, struct ucred *cred)); #endif /* KERNEL */ diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index bc683ad..d9333b2 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vfsops.c 8.8 (Berkeley) 5/20/95 - * $Id: ufs_vfsops.c,v 1.12 1998/11/10 09:16:28 peter Exp $ + * $Id: ufs_vfsops.c,v 1.13 1999/01/28 00:57:56 dillon Exp $ */ #include "opt_quota.h" @@ -115,7 +115,7 @@ ufs_quotactl(mp, cmds, uid, arg, p) break; /* fall through */ default: - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 961ad49..f2a0859 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 - * $Id: ufs_vnops.c,v 1.110 1999/02/26 05:34:16 imp Exp $ + * $Id: ufs_vnops.c,v 1.111 1999/03/02 05:31:47 imp Exp $ */ #include "opt_quota.h" @@ -448,7 +448,7 @@ ufs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != ip->i_uid && - (error = suser(cred, &p->p_acflag))) + (error = suser_xxx(cred, &p->p_acflag))) return (error); if (cred->cr_uid == 0) { if ((ip->i_flags @@ -504,7 +504,7 @@ ufs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != ip->i_uid && - (error = suser(cred, &p->p_acflag)) && + (error = suser_xxx(cred, &p->p_acflag)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, p)))) return (error); @@ -546,7 +546,7 @@ ufs_chmod(vp, mode, cred, p) int error; if (cred->cr_uid != ip->i_uid) { - error = suser(cred, &p->p_acflag); + error = suser_xxx(cred, &p->p_acflag); if (error) return (error); } @@ -594,7 +594,7 @@ ufs_chown(vp, uid, gid, cred, p) */ if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid || (gid != ip->i_gid && !groupmember((gid_t)gid, cred))) && - (error = suser(cred, &p->p_acflag))) + (error = suser_xxx(cred, &p->p_acflag))) return (error); ogid = ip->i_gid; ouid = ip->i_uid; @@ -2166,7 +2166,7 @@ ufs_makeinode(mode, dvp, vpp, cnp) if (DOINGSOFTDEP(tvp)) softdep_increase_linkcnt(ip); if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) && - suser(cnp->cn_cred, NULL)) + suser_xxx(cnp->cn_cred, NULL)) ip->i_mode &= ~ISGID; if (cnp->cn_flags & ISWHITEOUT) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 0931504..e722c6b 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 - * $Id: vm_mmap.c,v 1.92 1999/03/02 22:55:02 alc Exp $ + * $Id: vm_mmap.c,v 1.93 1999/04/19 14:14:10 peter Exp $ */ /* @@ -276,8 +276,7 @@ mmap(p, uap) if (securelevel >= 1) disablexworkaround = 1; else - disablexworkaround = suser(p->p_ucred, - &p->p_acflag); + disablexworkaround = suser(p); if (vp->v_type == VCHR && disablexworkaround && (flags & (MAP_PRIVATE|MAP_COPY))) return (EINVAL); @@ -873,7 +872,7 @@ mlock(p, uap) p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur) return (ENOMEM); #else - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); #endif @@ -938,7 +937,7 @@ munlock(p, uap) return (EINVAL); #ifndef pmap_wired_count - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); #endif diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 1280eac..30bc1c1 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 - * $Id: vm_swap.c,v 1.60 1999/02/25 05:37:18 dillon Exp $ + * $Id: vm_swap.c,v 1.61 1999/04/10 17:54:43 eivind Exp $ */ #include "opt_devfs.h" @@ -209,7 +209,7 @@ swapon(p, uap) struct nameidata nd; int error; - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) return (error); |