-/* $OpenBSD: mem.c,v 1.33 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.34 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: mem.c,v 1.26 2000/03/29 03:48:20 simonb Exp $ */
/*
break;
#ifdef APERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() unless
-/* $OpenBSD: promcons.c,v 1.18 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: promcons.c,v 1.19 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: promcons.c,v 1.5 1996/11/13 22:20:55 cgd Exp $ */
/*
ttsetwater(tp);
setuptimeout = 1;
- } else if (tp->t_state&TS_XCLUDE && suser(p, 0) != 0) {
+ } else if (tp->t_state&TS_XCLUDE && suser(p) != 0) {
splx(s);
return EBUSY;
}
-/* $OpenBSD: mem.c,v 1.33 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.34 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
break;
#ifdef APERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() unless
switch (minor(dev)) {
/* minor device 0 is physical memory */
case 0:
- if (suser(p, 0) != 0 && amd64_pa_used(off))
+ if (suser(p) != 0 && amd64_pa_used(off))
return -1;
return off;
-/* $OpenBSD: sys_machdep.c,v 1.19 2018/01/07 18:54:44 guenther Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.20 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: sys_machdep.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */
/*-
struct trapframe *tf = p->p_md.md_regs;
struct amd64_iopl_args ua;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return error;
#ifdef APERTURE
-/* $OpenBSD: mem.c,v 1.20 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.21 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */
/*
break;
#ifdef APERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() unless
/* minor device 0 is physical memory */
if ((paddr_t)off >= ptoa((paddr_t)physmem) &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return -1;
return off;
}
-/* $OpenBSD: mem.c,v 1.4 2018/02/17 22:33:00 kettenis Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */
/*
break;
#ifdef APERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() unless
/* minor device 0 is physical memory */
if ((paddr_t)off >= ptoa((paddr_t)physmem) &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return -1;
return off;
}
-/* $OpenBSD: pluart.c,v 1.6 2017/08/29 13:33:03 jsg Exp $ */
+/* $OpenBSD: pluart.c,v 1.7 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
case TIOCGFLAGS:
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return(EPERM);
break;
-/* $OpenBSD: pluart.c,v 1.6 2017/10/27 11:23:28 kevlo Exp $ */
+/* $OpenBSD: pluart.c,v 1.7 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
case TIOCGFLAGS:
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return(EPERM);
break;
-/* $OpenBSD: exuart.c,v 1.13 2017/10/27 11:23:28 kevlo Exp $ */
+/* $OpenBSD: exuart.c,v 1.14 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@motorola.com>
*
SET(tp->t_state, TS_CARR_ON); /* XXX */
- } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0)
+ } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0)
return EBUSY;
else
s = spltty();
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return(EPERM);
-/* $OpenBSD: imxuart.c,v 1.17 2017/12/30 13:34:56 kettenis Exp $ */
+/* $OpenBSD: imxuart.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@motorola.com>
*
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return(EPERM);
-/* $OpenBSD: pdc.c,v 1.39 2011/08/16 17:26:04 kettenis Exp $ */
+/* $OpenBSD: pdc.c,v 1.40 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1998-2003 Michael Shalayeff
ttsetwater(tp);
setuptimeout = 1;
- } else if (tp->t_state&TS_XCLUDE && suser(p, 0) != 0) {
+ } else if (tp->t_state&TS_XCLUDE && suser(p) != 0) {
splx(s);
return (EBUSY);
}
-/* $OpenBSD: amdmsr.c,v 1.9 2010/04/20 22:05:41 tedu Exp $ */
+/* $OpenBSD: amdmsr.c,v 1.10 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
if (amdmsr_cd.cd_ndevs == 0 || minor(dev) != 0)
return ENXIO;
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return EPERM;
/* allow only one simultaneous open() */
if (amdmsr_open_cnt > 0)
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.53 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.54 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
break;
#ifdef APERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() unless
switch (minor(dev)) {
/* minor device 0 is physical memory */
case 0:
- if ((u_int)off > ptoa(physmem) && suser(p, 0) != 0)
+ if ((u_int)off > ptoa(physmem) && suser(p) != 0)
return -1;
return off;
-/* $OpenBSD: sys_machdep.c,v 1.38 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.39 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */
/*-
struct trapframe *tf = p->p_md.md_regs;
struct i386_iopl_args ua;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return error;
#ifdef APERTURE
if (!allowaperture && securelevel > 0)
-/* $OpenBSD: siotty.c,v 1.21 2017/11/03 06:54:06 aoyama Exp $ */
+/* $OpenBSD: siotty.c,v 1.22 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: siotty.c,v 1.9 2002/03/17 19:40:43 atatat Exp $ */
/*-
tp = sc->sc_tty;
if ((tp->t_state & TS_ISOPEN) && (tp->t_state & TS_XCLUDE)
- && suser(p, 0) != 0)
+ && suser(p) != 0)
return EBUSY;
if ((tp->t_state & TS_ISOPEN) == 0) {
siomctl(sc, *(int *)data, DMBIC);
break;
case TIOCSFLAGS: /* Instruct how serial port behaves */
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return EPERM;
sc->sc_flags = *(int *)data;
-/* $OpenBSD: mem.c,v 1.26 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.27 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
break;
#ifdef APERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() unless
-/* $OpenBSD: scif.c,v 1.18 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: scif.c,v 1.19 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: scif.c,v 1.47 2006/07/23 22:06:06 ad Exp $ */
/*-
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return (EBUSY);
s = spltty();
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error)
break;
sc->sc_swflags = *(int *)data;
-/* $OpenBSD: mem.c,v 1.10 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.11 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: mem.c,v 1.21 2006/07/23 22:06:07 ad Exp $ */
/*
if (minor(dev) != 0)
return (-1);
- if (__mm_mem_addr((paddr_t)off) == FALSE && suser(p, 0) != 0)
+ if (__mm_mem_addr((paddr_t)off) == FALSE && suser(p) != 0)
return (-1);
return ((paddr_t)off);
}
-/* $OpenBSD: mem.c,v 1.8 2017/12/14 03:30:43 guenther Exp $ */
+/* $OpenBSD: mem.c,v 1.9 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
break;
#ifdef xAPERTURE
case 4:
- if (suser(p, 0) != 0 || !allowaperture)
+ if (suser(p) != 0 || !allowaperture)
return (EPERM);
/* authorize only one simultaneous open() */
-/* $OpenBSD: pcons.c,v 1.23 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: pcons.c,v 1.24 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: pcons.c,v 1.7 2001/05/02 10:32:20 scw Exp $ */
/*-
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
pconsparam(tp, &tp->t_termios);
ttsetwater(tp);
- } else if ((tp->t_state & TS_XCLUDE) && suser(p, 0))
+ } else if ((tp->t_state & TS_XCLUDE) && suser(p))
return EBUSY;
tp->t_state |= TS_CARR_ON;
-/* $OpenBSD: sab.c,v 1.34 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: sab.c,v 1.35 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
else
tp->t_state &= ~TS_CARR_ON;
} else if ((tp->t_state & TS_XCLUDE) &&
- (!suser(p, 0))) {
+ (!suser(p))) {
return (EBUSY);
} else {
s = spltty();
*((int *)data) = sc->sc_openflags;
break;
case TIOCSFLAGS:
- if (suser(p, 0))
+ if (suser(p))
error = EPERM;
else
sc->sc_openflags = *((int *)data) &
-/* $OpenBSD: sbbc.c,v 1.12 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: sbbc.c,v 1.13 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
*
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
ttsetwater(tp);
- } else if ((tp->t_state & TS_XCLUDE) && suser(p, 0))
+ } else if ((tp->t_state & TS_XCLUDE) && suser(p))
return (EBUSY);
tp->t_state |= TS_CARR_ON;
-/* $OpenBSD: vcctty.c,v 1.13 2018/01/17 15:52:33 stsp Exp $ */
+/* $OpenBSD: vcctty.c,v 1.14 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
*
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
ttsetwater(tp);
- } else if ((tp->t_state & TS_XCLUDE) && suser(p, 0))
+ } else if ((tp->t_state & TS_XCLUDE) && suser(p))
return (EBUSY);
tp->t_state |= TS_CARR_ON;
-/* $OpenBSD: vcons.c,v 1.15 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: vcons.c,v 1.16 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
*
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
ttsetwater(tp);
- } else if ((tp->t_state & TS_XCLUDE) && suser(p, 0))
+ } else if ((tp->t_state & TS_XCLUDE) && suser(p))
return (EBUSY);
tp->t_state |= TS_CARR_ON;
-/* $OpenBSD: acpi.c,v 1.339 2018/02/10 05:24:23 deraadt Exp $ */
+/* $OpenBSD: acpi.c,v 1.340 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
break;
#ifdef HIBERNATE
case APM_IOC_HIBERNATE:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
if ((flag & FWRITE) == 0) {
error = EBADF;
-/* $OpenBSD: cons.c,v 1.27 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: cons.c,v 1.28 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: cons.c,v 1.30 1996/04/08 19:57:30 jonathan Exp $ */
/*
* output from the "virtual" console.
*/
if (cmd == TIOCCONS && constty != NULL) {
- error = suser(p, SUSER_NOACCT);
+ error = suser(p);
if (error)
return (error);
constty = NULL;
-/* $OpenBSD: an.c,v 1.72 2017/01/22 10:17:37 dlg Exp $ */
+/* $OpenBSD: an.c,v 1.73 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
if (nwkey->i_key[i].i_keydat == NULL)
continue;
/* do not show any keys to non-root user */
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
nwkey->i_key[i].i_keylen = sc->sc_wepkeys[i].an_wep_keylen;
if (nwkey->i_key[i].i_keylen < 0) {
-/* $OpenBSD: com.c,v 1.164 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: com.c,v 1.165 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
SET(tp->t_state, TS_CARR_ON);
else
CLR(tp->t_state, TS_CARR_ON);
- } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0)
+ } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0)
return EBUSY;
else
s = spltty();
case TIOCSFLAGS: {
int userbits, driverbits = 0;
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return(EPERM);
-/* $OpenBSD: cy.c,v 1.37 2017/09/08 05:36:52 deraadt Exp $ */
+/* $OpenBSD: cy.c,v 1.38 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1996 Timo Rossi.
* All rights reserved.
SET(tp->t_state, TS_CARR_ON);
else
CLR(tp->t_state, TS_CARR_ON);
- } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) {
+ } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) {
return (EBUSY);
} else {
s = spltty();
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error != 0)
return (EPERM);
-/* $OpenBSD: if_wi.c,v 1.167 2017/01/22 10:17:38 dlg Exp $ */
+/* $OpenBSD: if_wi.c,v 1.168 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
break;
case WI_RID_DEFLT_CRYPT_KEYS:
/* For non-root user, return all-zeroes keys */
- if (suser(p, 0))
+ if (suser(p))
bzero(wreq, sizeof(struct wi_ltv_keys));
else
bcopy(&sc->wi_keys, wreq,
error = copyout(wreq, ifr->ifr_data, sizeof(*wreq));
break;
case SIOCSWAVELAN:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
wreq = malloc(sizeof *wreq, M_DEVBUF, M_WAITOK | M_ZERO);
error = copyin(ifr->ifr_data, wreq, sizeof(*wreq));
error = copyout(wreq, ifr->ifr_data, sizeof(*wreq));
break;
case SIOCSPRISM2DEBUG:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
wreq = malloc(sizeof *wreq, M_DEVBUF, M_WAITOK | M_ZERO);
error = copyin(ifr->ifr_data, wreq, sizeof(*wreq));
}
break;
case SIOCS80211NWID:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
nwidp = malloc(sizeof *nwidp, M_DEVBUF, M_WAITOK);
error = copyin(ifr->ifr_data, nwidp, sizeof(*nwidp));
wi_init(sc);
break;
case SIOCS80211NWKEY:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = wi_set_nwkey(sc, (struct ieee80211_nwkey *)data);
break;
error = wi_get_nwkey(sc, (struct ieee80211_nwkey *)data);
break;
case SIOCS80211POWER:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = wi_set_pm(sc, (struct ieee80211_power *)data);
break;
error = wi_get_pm(sc, (struct ieee80211_power *)data);
break;
case SIOCS80211TXPOWER:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = wi_set_txpower(sc, (struct ieee80211_txpower *)data);
break;
error = wi_get_txpower(sc, (struct ieee80211_txpower *)data);
break;
case SIOCS80211CHANNEL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
if (((struct ieee80211chanreq *)data)->i_channel > 14) {
error = EINVAL;
IEEE80211_ADDR_COPY(bssid->i_bssid, wreq->wi_val);
break;
case SIOCS80211SCAN:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
if (sc->wi_ptype == WI_PORTTYPE_HOSTAP)
break;
{
struct ieee80211_nodereq *nr = NULL;
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
na = (struct ieee80211_nodereq_all *)data;
if (sc->wi_ptype == WI_PORTTYPE_HOSTAP) {
}
break;
case SIOCS80211FLAGS:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
if (sc->wi_ptype != WI_PORTTYPE_HOSTAP) {
error = EINVAL;
nwkey->i_defkid = sc->wi_tx_key + 1;
/* do not show any keys to non-root user */
- error = suser(curproc, 0);
+ error = suser(curproc);
for (i = 0; i < IEEE80211_WEP_NKID; i++) {
if (nwkey->i_key[i].i_keydat == NULL)
continue;
-/* $OpenBSD: if_wi_hostap.c,v 1.51 2015/11/24 17:11:39 mpi Exp $ */
+/* $OpenBSD: if_wi_hostap.c,v 1.52 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2002
switch (command) {
case SIOCHOSTAP_DEL:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
if ((error = copyin(ifr->ifr_data, &reqsta, sizeof(reqsta))))
break;
break;
case SIOCHOSTAP_ADD:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
if ((error = copyin(ifr->ifr_data, &reqsta, sizeof(reqsta))))
break;
break;
case SIOCHOSTAP_SFLAGS:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
if ((error = copyin(ifr->ifr_data, &flag, sizeof(int))))
break;
-/* $OpenBSD: z8530tty.c,v 1.29 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.30 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return (EBUSY);
s = spltty();
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error)
break;
zst->zst_swflags = *(int *)data;
-/* $OpenBSD: cz.c,v 1.20 2014/07/13 23:10:23 deraadt Exp $ */
+/* $OpenBSD: cz.c,v 1.21 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: cz.c,v 1.15 2001/01/20 19:10:36 thorpej Exp $ */
/*-
if (ISSET(tp->t_state, TS_ISOPEN) &&
ISSET(tp->t_state, TS_XCLUDE) &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return (EBUSY);
s = spltty();
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error)
break;
sc->sc_swflags = *(int *)data;
-/* $OpenBSD: drmP.h,v 1.216 2018/01/13 13:03:42 robert Exp $ */
+/* $OpenBSD: drmP.h,v 1.217 2018/02/19 08:59:52 mpi Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
#define DRM_MAXUNITS 8
/* DRM_SUSER returns true if the user is superuser */
-#define DRM_SUSER(p) (suser(p, 0) == 0)
+#define DRM_SUSER(p) (suser(p) == 0)
#define DRM_MTRR_WC MDF_WRITECOMBINE
#define DRM_WAKEUP(x) wakeup(x)
-/* $OpenBSD: drm_linux.h,v 1.83 2018/01/31 10:17:22 jsg Exp $ */
+/* $OpenBSD: drm_linux.h,v 1.84 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
* Copyright (c) 2017 Martin Pieuchot
capable(int cap)
{
KASSERT(cap == CAP_SYS_ADMIN);
- return suser(curproc, 0);
+ return suser(curproc);
}
typedef int pgprot_t;
-/* $OpenBSD: viocon.c,v 1.2 2017/05/30 17:47:11 krw Exp $ */
+/* $OpenBSD: viocon.c,v 1.3 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2013-2015 Stefan Fritsch <sf@sfritsch.de>
ttsetwater(tp);
splx(s);
}
- else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) {
+ else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) {
return (EBUSY);
}
-/* $OpenBSD: magma.c,v 1.27 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: magma.c,v 1.28 2018/02/19 08:59:52 mpi Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
SET(tp->t_state, TS_CARR_ON);
else
CLR(tp->t_state, TS_CARR_ON);
- } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) {
+ } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) {
return (EBUSY); /* superuser can break exclusive access */
} else {
s = spltty();
break;
case TIOCSFLAGS:
- if (suser(p, 0))
+ if (suser(p))
error = EPERM;
else
mp->mp_openflags = *((int *)data) &
-/* $OpenBSD: spif.c,v 1.20 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: spif.c,v 1.21 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net)
else
CLR(tp->t_state, TS_CARR_ON);
}
- else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) {
+ else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) {
return (EBUSY);
} else {
s = spltty();
*((int *)data) = sp->sp_openflags;
break;
case TIOCSFLAGS:
- if (suser(p, 0))
+ if (suser(p))
error = EPERM;
else
sp->sp_openflags = *((int *)data) &
-/* $OpenBSD: if_umb.c,v 1.17 2017/10/23 15:23:13 gerhard Exp $ */
+/* $OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2016 genua mbH
sizeof (sc->sc_info));
break;
case SIOCSUMBPARAM:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
if ((error = copyin(ifr->ifr_data, &mp, sizeof (mp))) != 0)
break;
-/* $OpenBSD: ucom.c,v 1.66 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: ucom.c,v 1.67 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */
/*
SET(tp->t_state, TS_CARR_ON);
else
CLR(tp->t_state, TS_CARR_ON);
- } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0)
+ } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0)
return (EBUSY);
else
s = spltty();
break;
case TIOCSFLAGS:
- error = suser(p, 0);
+ error = suser(p);
if (error)
break;
sc->sc_swflags = *(int *)data;
-/* $OpenBSD: usb.c,v 1.115 2018/02/03 13:37:37 mpi Exp $ */
+/* $OpenBSD: usb.c,v 1.116 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
#ifdef USB_DEBUG
case USB_SETDEBUG:
/* only root can access to these debug flags */
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
return (error);
if (!(flag & FWRITE))
return (EBADF);
-/* $OpenBSD: vnd.c,v 1.166 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: vnd.c,v 1.167 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
DNPRINTF(VDB_FOLLOW, "vndioctl(%x, %lx, %p, %x, %p): unit %d\n",
dev, cmd, addr, flag, p, unit);
- error = suser(p, 0);
+ error = suser(p);
if (error)
return (error);
if (unit >= numvnd)
-/* $OpenBSD: wsdisplay.c,v 1.130 2018/01/17 16:54:19 fcambus Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.131 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
wsdisplayparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state & TS_XCLUDE) != 0 &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return (EBUSY);
tp->t_state |= TS_CARR_ON;
-/* $OpenBSD: wskbd.c,v 1.89 2018/01/22 12:20:54 fcambus Exp $ */
+/* $OpenBSD: wskbd.c,v 1.90 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */
/*
return (0);
case WSKBDIO_SETDEFAULTBELL:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
kbdp = &wskbd_default_bell_data;
goto setbell;
return (0);
case WSKBDIO_SETDEFAULTKEYREPEAT:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
kkdp = &wskbd_default_keyrepeat_data;
goto setkeyrepeat;
-/* $OpenBSD: kern_acct.c,v 1.34 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.35 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
int error;
/* Make sure that the caller is root. */
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
/*
-/* $OpenBSD: kern_descrip.c,v 1.141 2017/07/20 16:47:21 mpi Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.142 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
* Don't let non-root see generation numbers
* (for NFS security)
*/
- if (suser(p, 0))
+ if (suser(p))
ub.st_gen = 0;
error = copyout((caddr_t)&ub, (caddr_t)SCARG(uap, sb),
sizeof (ub));
-/* $OpenBSD: kern_ktrace.c,v 1.94 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: kern_ktrace.c,v 1.95 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */
/*
goto done;
}
if (ops == KTROP_SET) {
- if (suser(p, 0) == 0)
+ if (suser(p) == 0)
facs |= KTRFAC_ROOT;
ktrstart(p, vp, cred);
}
-/* $OpenBSD: kern_prot.c,v 1.71 2017/09/27 06:45:00 deraadt Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.72 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
ruid != uc->cr_ruid &&
ruid != uc->cr_uid &&
ruid != uc->cr_svuid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
if (euid != (uid_t)-1 &&
euid != uc->cr_ruid &&
euid != uc->cr_uid &&
euid != uc->cr_svuid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
if (suid != (uid_t)-1 &&
suid != uc->cr_ruid &&
suid != uc->cr_uid &&
suid != uc->cr_svuid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
rgid != uc->cr_rgid &&
rgid != uc->cr_gid &&
rgid != uc->cr_svgid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
if (egid != (gid_t)-1 &&
egid != uc->cr_rgid &&
egid != uc->cr_gid &&
egid != uc->cr_svgid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
if (sgid != (gid_t)-1 &&
sgid != uc->cr_rgid &&
sgid != uc->cr_gid &&
sgid != uc->cr_svgid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
rgid != uc->cr_rgid &&
rgid != uc->cr_gid &&
rgid != uc->cr_svgid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
if (egid != (gid_t)-1 &&
egid != uc->cr_rgid &&
egid != uc->cr_gid &&
egid != uc->cr_svgid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
ruid != uc->cr_ruid &&
ruid != uc->cr_uid &&
ruid != uc->cr_svuid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
if (euid != (uid_t)-1 &&
euid != uc->cr_ruid &&
euid != uc->cr_uid &&
euid != uc->cr_svuid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
if (uid != uc->cr_ruid &&
uid != uc->cr_svuid &&
uid != uc->cr_uid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
/*
* Everything's okay, do it.
*/
- if (uid == pruc->cr_uid || suser(p, 0) == 0) {
+ if (uid == pruc->cr_uid || suser(p) == 0) {
did_real = 1;
newcred->cr_ruid = uid;
newcred->cr_svuid = uid;
return (0);
if (euid != uc->cr_ruid && euid != uc->cr_svuid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
if (gid != uc->cr_rgid &&
gid != uc->cr_svgid &&
gid != uc->cr_gid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
pruc = pr->ps_ucred;
crset(newcred, pruc);
- if (gid == pruc->cr_gid || suser(p, 0) == 0) {
+ if (gid == pruc->cr_gid || suser(p) == 0) {
newcred->cr_rgid = gid;
newcred->cr_svgid = gid;
}
return (0);
if (egid != uc->cr_rgid && egid != uc->cr_svgid &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
u_int ngrp;
int error;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
ngrp = SCARG(uap, gidsetsize);
if (ngrp > NGROUPS_MAX)
* Returns 0 or error.
*/
int
-suser(struct proc *p, u_int flags)
+suser(struct proc *p)
{
struct ucred *cred = p->p_ucred;
- if (cred->cr_uid == 0) {
- if (!(flags & SUSER_NOACCT))
- p->p_p->ps_acflag |= ASU;
+ if (cred->cr_uid == 0)
return (0);
- }
return (EPERM);
}
char buf[sizeof(s->s_login)];
int error;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
error = copyinstr(SCARG(uap, namebuf), buf, sizeof(buf), NULL);
if (error == 0)
-/* $OpenBSD: kern_resource.c,v 1.57 2016/09/15 02:00:16 dlg Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.58 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
if (n < PRIO_MIN)
n = PRIO_MIN;
n += NZERO;
- if (n < chgpr->ps_nice && suser(curp, 0))
+ if (n < chgpr->ps_nice && suser(curp))
return (EACCES);
chgpr->ps_nice = n;
SCHED_LOCK(s);
alimp = &p->p_rlimit[which];
if (limp->rlim_max > alimp->rlim_max)
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if (p->p_p->ps_limit->p_refcnt > 1) {
struct plimit *l = p->p_p->ps_limit;
-/* $OpenBSD: kern_sig.c,v 1.214 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.215 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
* If the process has inconsistent uids, nosuidcoredump
* determines coredump placement policy.
*/
- if (((pr->ps_flags & PS_SUGID) && (error = suser(p, 0))) ||
+ if (((pr->ps_flags & PS_SUGID) && (error = suser(p))) ||
((pr->ps_flags & PS_SUGID) && nosuidcoredump)) {
if (nosuidcoredump == 3 || nosuidcoredump == 2)
incrash = 1;
-/* $OpenBSD: kern_sysctl.c,v 1.331 2018/01/02 06:38:45 guenther Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.332 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
int name[CTL_MAXNAME];
if (SCARG(uap, new) != NULL &&
- (error = suser(p, 0)))
+ (error = suser(p)))
return (error);
/*
* all top-level sysctl names are non-terminal
return (sysctl_rdint(oldp, oldlenp, newp, mp->msg_bufs));
}
case KERN_CONSBUF:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
/* FALLTHROUGH */
case KERN_MSGBUF: {
kf->f_data = PTRTOINT64(fp->f_data);
kf->f_usecount = 0;
- if (suser(p, 0) == 0 || p->p_ucred->cr_uid == fp->f_cred->cr_uid) {
+ if (suser(p) == 0 || p->p_ucred->cr_uid == fp->f_cred->cr_uid) {
kf->f_offset = fp->f_offset;
kf->f_rxfer = fp->f_rxfer;
kf->f_rwfer = fp->f_wxfer;
if (elem_size < 1)
return (EINVAL);
- show_pointers = suser(curproc, 0) == 0;
+ show_pointers = suser(curproc) == 0;
kf = malloc(sizeof(*kf), M_TEMP, M_WAITOK);
dothreads = op & KERN_PROC_SHOW_THREADS;
op &= ~KERN_PROC_SHOW_THREADS;
- show_pointers = suser(curproc, 0) == 0;
+ show_pointers = suser(curproc) == 0;
if (where != NULL)
kproc = malloc(sizeof(*kproc), M_TEMP, M_WAITOK);
/* Only owner or root can get env */
if ((op == KERN_PROC_NENV || op == KERN_PROC_ENV) &&
(vpr->ps_ucred->cr_uid != cp->p_ucred->cr_uid &&
- (error = suser(cp, 0)) != 0))
+ (error = suser(cp)) != 0))
return (error);
ps_strings = vpr->ps_strings;
/* Only owner or root can get cwd */
if (findpr->ps_ucred->cr_uid != cp->p_ucred->cr_uid &&
- (error = suser(cp, 0)) != 0)
+ (error = suser(cp)) != 0)
return (error);
len = *oldlenp;
return (EINVAL);
/* Only root can change PS_NOBROADCASTKILL */
- if (newp != 0 && (error = suser(cp, 0)) != 0)
+ if (newp != 0 && (error = suser(cp)) != 0)
return (error);
/* get the PS_NOBROADCASTKILL flag */
#if 1
/* XXX Allow only root for now */
- if ((error = suser(cp, 0)) != 0)
+ if ((error = suser(cp)) != 0)
return (error);
#else
/* Only owner or root can get vmmap */
if (findpr->ps_ucred->cr_uid != cp->p_ucred->cr_uid &&
- (error = suser(cp, 0)) != 0)
+ (error = suser(cp)) != 0)
return (error);
#endif
} else {
/* Only root can get kernel_map */
- if ((error = suser(cp, 0)) != 0)
+ if ((error = suser(cp)) != 0)
return (error);
findpr = NULL;
}
-/* $OpenBSD: kern_time.c,v 1.100 2017/12/18 05:51:53 cheloha Exp $ */
+/* $OpenBSD: kern_time.c,v 1.101 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
clockid_t clock_id;
int error;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if ((error = copyin(SCARG(uap, tp), &ats, sizeof(ats))) != 0)
tv = SCARG(uap, tv);
tzp = SCARG(uap, tzp);
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
/* Verify all parameters before changing time. */
if (tv && (error = copyin(tv, &atv, sizeof(atv))))
return (error);
}
if (freq) {
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
if ((error = copyin(freq, &f, sizeof(f))))
return (error);
}
if (delta) {
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
if ((error = copyin(delta, &atv, sizeof(struct timeval))))
-/* $OpenBSD: kern_xxx.c,v 1.33 2017/01/21 05:42:03 guenther Exp $ */
+/* $OpenBSD: kern_xxx.c,v 1.34 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: kern_xxx.c,v 1.32 1996/04/22 01:38:41 christos Exp $ */
/*
} */ *uap = v;
int error;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
#ifdef MULTIPROCESSOR
-/* $OpenBSD: subr_log.c,v 1.54 2017/10/17 08:29:43 mpi Exp $ */
+/* $OpenBSD: subr_log.c,v 1.55 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
break;
case LIOCSFD:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
fp = syslogf;
if ((error = getsock(p, *(int *)data, &syslogf)) != 0)
-/* $OpenBSD: sys_process.c,v 1.78 2017/10/14 10:17:08 guenther Exp $ */
+/* $OpenBSD: sys_process.c,v 1.79 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
*/
if ((tr->ps_ucred->cr_ruid != p->p_ucred->cr_ruid ||
ISSET(tr->ps_flags, PS_SUGIDEXEC | PS_SUGID)) &&
- (error = suser(p, 0)) != 0)
+ (error = suser(p)) != 0)
return (error);
/*
* (5.5) it's not a child of the tracing process.
*/
if (global_ptrace == 0 && !inferior(tr, p->p_p) &&
- (error = suser(p, 0)) != 0)
+ (error = suser(p)) != 0)
return (error);
/*
if ((tr->ps_ucred->cr_ruid != p->p_ucred->cr_ruid ||
ISSET(tr->ps_flags, PS_SUGIDEXEC | PS_SUGID)) &&
- (error = suser(p, 0)) != 0)
+ (error = suser(p)) != 0)
return (error);
if ((tr->ps_pid == 1) && (securelevel > -1))
-/* $OpenBSD: tty.c,v 1.136 2018/02/06 01:24:31 tedu Exp $ */
+/* $OpenBSD: tty.c,v 1.137 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
splx(s);
break;
case TIOCGPGRP: /* get pgrp of tty */
- if (!isctty(pr, tp) && suser(p, 0))
+ if (!isctty(pr, tp) && suser(p))
return (ENOTTY);
*(int *)data = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
break;
-/* $OpenBSD: tty_endrun.c,v 1.7 2015/12/21 21:49:02 sf Exp $ */
+/* $OpenBSD: tty_endrun.c,v 1.8 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
DPRINTF(("endrunopen\n"));
if (tp->t_line == ENDRUNDISC)
return ENODEV;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return error;
np = malloc(sizeof(struct endrun), M_DEVBUF, M_WAITOK|M_ZERO);
snprintf(np->timedev.xname, sizeof(np->timedev.xname), "endrun%d",
-/* $OpenBSD: tty_msts.c,v 1.20 2015/12/21 21:49:02 sf Exp $ */
+/* $OpenBSD: tty_msts.c,v 1.21 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
DPRINTF(("mstsopen\n"));
if (tp->t_line == MSTSDISC)
return ENODEV;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return error;
np = malloc(sizeof(struct msts), M_DEVBUF, M_WAITOK|M_ZERO);
snprintf(np->timedev.xname, sizeof(np->timedev.xname), "msts%d",
-/* $OpenBSD: tty_nmea.c,v 1.45 2015/12/21 21:49:02 sf Exp $ */
+/* $OpenBSD: tty_nmea.c,v 1.46 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2006, 2007, 2008 Marc Balmer <mbalmer@openbsd.org>
if (tp->t_line == NMEADISC)
return (ENODEV);
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
np = malloc(sizeof(struct nmea), M_DEVBUF, M_WAITOK | M_ZERO);
snprintf(np->timedev.xname, sizeof(np->timedev.xname), "nmea%d",
-/* $OpenBSD: tty_pty.c,v 1.82 2018/01/08 11:52:14 mpi Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.83 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
tp->t_cflag = TTYDEF_CFLAG;
tp->t_ispeed = tp->t_ospeed = B115200;
ttsetwater(tp); /* would be done in xxparam() */
- } else if (tp->t_state & TS_XCLUDE && suser(p, 0) != 0)
+ } else if (tp->t_state & TS_XCLUDE && suser(p) != 0)
return (EBUSY);
if (tp->t_oproc) /* Ctrlr still around. */
tp->t_state |= TS_CARR_ON;
-/* $OpenBSD: tty_tty.c,v 1.21 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.22 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
}
switch (cmd) {
case TIOCSETVERAUTH:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return error;
secs = *(int *)addr;
if (secs < 1 || secs > 3600)
-/* $OpenBSD: uipc_socket.c,v 1.215 2018/01/10 18:14:34 bluhm Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.216 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
TAILQ_INIT(&so->so_q0);
TAILQ_INIT(&so->so_q);
so->so_type = type;
- if (suser(p, 0) == 0)
+ if (suser(p) == 0)
so->so_state = SS_PRIV;
so->so_ruid = p->p_ucred->cr_ruid;
so->so_euid = p->p_ucred->cr_uid;
} else {
switch (optname) {
case SO_BINDANY:
- if ((error = suser(curproc, 0)) != 0) /* XXX */
+ if ((error = suser(curproc)) != 0) /* XXX */
return (error);
break;
}
-/* $OpenBSD: uipc_syscalls.c,v 1.164 2018/02/11 21:53:57 matthieu Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.165 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
if (p->p_p->ps_rtableid == (u_int)rtableid)
return (0);
- if (p->p_p->ps_rtableid != 0 && (error = suser(p, 0)) != 0)
+ if (p->p_p->ps_rtableid != 0 && (error = suser(p)) != 0)
return (error);
if (rtableid < 0 || !rtable_exists((u_int)rtableid))
return (EINVAL);
-/* $OpenBSD: vfs_syscalls.c,v 1.275 2018/02/10 05:24:23 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.276 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
int flags = SCARG(uap, flags);
void *args = NULL;
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
/*
int error;
struct nameidata nd;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
int error;
/* Don't let non-root see filesystem id (for NFS security) */
- if (suser(p, 0)) {
+ if (suser(p)) {
fsid_t fsid;
s = (char *)sp;
int error;
struct nameidata nd;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
/*
* Must be super user
*/
- error = suser(p, 0);
+ error = suser(p);
if (error)
return (error);
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
/*
* Must be super user
*/
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
flags = FFLAGS(SCARG(uap, flags));
/*
* Must be super user
*/
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
/*
* Must be super user
*/
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
return (error);
if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fhandle_t))) != 0)
vp = nd.ni_vp;
if (!S_ISFIFO(mode) || dev != 0) {
if ((nd.ni_dvp->v_mount->mnt_flag & MNT_NOPERM) == 0 &&
- (error = suser(p, 0)) != 0)
+ (error = suser(p)) != 0)
goto out;
if (p->p_fd->fd_rdir) {
error = EINVAL;
return (ENOENT);
}
/* Don't let non-root see generation numbers (for NFS security) */
- if (suser(p, 0))
+ if (suser(p))
sb.st_gen = 0;
error = copyout(&sb, buf, sizeof(sb));
#ifdef KTRACE
else if (flags == VNOVAL)
error = EINVAL;
else {
- if (suser(p, 0)) {
+ if (suser(p)) {
if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p))
!= 0)
goto out;
goto out;
if ((uid != -1 || gid != -1) &&
(vp->v_mount->mnt_flag & MNT_NOPERM) == 0 &&
- (suser(p, 0) || suid_clear)) {
+ (suser(p) || suid_clear)) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
goto out;
goto out;
if ((uid != -1 || gid != -1) &&
(vp->v_mount->mnt_flag & MNT_NOPERM) == 0 &&
- (suser(p, 0) || suid_clear)) {
+ (suser(p) || suid_clear)) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
goto out;
goto out;
if ((uid != -1 || gid != -1) &&
(vp->v_mount->mnt_flag & MNT_NOPERM) == 0 &&
- (suser(p, 0) || suid_clear)) {
+ (suser(p) || suid_clear)) {
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
if (error)
goto out;
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, 0)))
+ (error = suser(p)))
goto out;
if (vp->v_usecount > 1 || (vp->v_flag & (VALIASED)))
VOP_REVOKE(vp, REVOKEALL);
-/* $OpenBSD: bpf.c,v 1.167 2018/02/01 12:10:27 dlg Exp $ */
+/* $OpenBSD: bpf.c,v 1.168 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
int error = 0;
d = bpfilter_lookup(minor(dev));
- if (d->bd_locked && suser(p, 0) != 0) {
+ if (d->bd_locked && suser(p) != 0) {
/* list of allowed ioctls when locked and not root */
switch (cmd) {
case BIOCGBLEN:
-/* $OpenBSD: if.c,v 1.545 2018/02/19 00:24:48 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.546 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
switch (cmd) {
case SIOCIFCREATE:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
NET_LOCK();
error = if_clone_create(ifr->ifr_name, 0);
NET_UNLOCK();
return (error);
case SIOCIFDESTROY:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
NET_LOCK();
error = if_clone_destroy(ifr->ifr_name);
NET_UNLOCK();
return (error);
case SIOCSIFGATTR:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
NET_LOCK();
error = if_setgroupattribs(data);
switch (cmd) {
case SIOCIFAFATTACH:
case SIOCIFAFDETACH:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
NET_LOCK();
switch (ifar->ifar_af) {
break;
case SIOCSIFFLAGS:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
NET_LOCK();
break;
case SIOCSIFXFLAGS:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
NET_LOCK();
break;
case SIOCSIFMETRIC:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
NET_LOCK();
ifp->if_metric = ifr->ifr_metric;
break;
case SIOCSIFMTU:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
NET_LOCK();
error = (*ifp->if_ioctl)(ifp, cmd, data);
break;
case SIOCSIFDESCR:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
error = copyinstr(ifr->ifr_data, ifdescrbuf,
IFDESCRSIZE, &bytesdone);
break;
case SIOCSIFRTLABEL:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
error = copyinstr(ifr->ifr_data, ifrtlabelbuf,
RTLABEL_LEN, &bytesdone);
break;
case SIOCSIFPRIORITY:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
if (ifr->ifr_metric < 0 || ifr->ifr_metric > 15) {
error = EINVAL;
break;
case SIOCSIFRDOMAIN:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
NET_LOCK();
error = if_setrdomain(ifp, ifr->ifr_rdomainid);
break;
case SIOCAIFGROUP:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
NET_LOCK();
error = if_addgroup(ifp, ifgr->ifgr_group);
break;
case SIOCDIFGROUP:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
NET_LOCK();
error = (*ifp->if_ioctl)(ifp, cmd, data);
break;
case SIOCSIFLLADDR:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
if ((ifp->if_sadl == NULL) ||
(ifr->ifr_addr.sa_len != ETHER_ADDR_LEN) ||
break;
case SIOCSIFLLPRIO:
- if ((error = suser(p, 0)))
+ if ((error = suser(p)))
break;
if (ifr->ifr_llprio > UCHAR_MAX) {
error = EINVAL;
case SIOCSIFPAIR:
case SIOCSIFPARENT:
case SIOCDIFPARENT:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
/* FALLTHROUGH */
default:
-/* $OpenBSD: if_bridge.c,v 1.306 2018/02/11 02:17:46 henning Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.307 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
case SIOCBRDGADD:
/* bridge(4) does not distinguish between routing/forwarding ports */
case SIOCBRDGADDL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
ifs = ifunit(req->ifbr_ifsname);
TAILQ_INSERT_TAIL(&sc->sc_iflist, p, next);
break;
case SIOCBRDGDEL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
ifs = ifunit(req->ifbr_ifsname);
if (ifs == NULL) {
error = bridge_bifconf(sc, (struct ifbifconf *)data);
break;
case SIOCBRDGADDS:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
ifs = ifunit(req->ifbr_ifsname);
if (ifs == NULL) { /* no such interface */
TAILQ_INSERT_TAIL(&sc->sc_spanlist, p, next);
break;
case SIOCBRDGDELS:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
TAILQ_FOREACH(p, &sc->sc_spanlist, next) {
if (strncmp(p->ifp->if_xname, req->ifbr_ifsname,
}
break;
case SIOCBRDGSIFFLGS:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
ifs = ifunit(req->ifbr_ifsname);
if (ifs == NULL) {
case SIOCBRDGSPROTO:
case SIOCBRDGSIFPRIO:
case SIOCBRDGSIFCOST:
- error = suser(curproc, 0);
+ error = suser(curproc);
break;
default:
error = ENOTTY;
-/* $OpenBSD: if_mpw.c,v 1.23 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_mpw.c,v 1.24 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2015 Rafael Zalamena <rzalamena@openbsd.org>
break;
case SIOCSETMPWCFG:
- error = suser(curproc, 0);
+ error = suser(curproc);
if (error != 0)
break;
-/* $OpenBSD: if_pflow.c,v 1.86 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.87 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2011 Florian Obser <florian@narrans.de>
break;
case SIOCSETPFLOW:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if ((error = copyin(ifr->ifr_data, &pflowr,
sizeof(pflowr))))
-/* $OpenBSD: if_pfsync.c,v 1.256 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.257 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
return (copyout(&pfsyncr, ifr->ifr_data, sizeof(pfsyncr)));
case SIOCSETPFSYNC:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if ((error = copyin(ifr->ifr_data, &pfsyncr, sizeof(pfsyncr))))
return (error);
-/* $OpenBSD: if_ppp.c,v 1.110 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.111 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
break;
case PPPIOCSFLAGS:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
flags = *(int *)data & SC_MASK;
#ifdef PPP_COMPRESS
break;
case PPPIOCSMRU:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
mru = *(int *)data;
if (mru >= PPP_MRU && mru <= PPP_MAXMRU)
#ifdef VJC
case PPPIOCSMAXCID:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if (sc->sc_comp)
sl_compress_setup(sc->sc_comp, *(int *)data);
#endif
case PPPIOCXFERUNIT:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
sc->sc_xfer = p->p_p->ps_pid;
break;
#ifdef PPP_COMPRESS
case PPPIOCSCOMPRESS:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
odp = (struct ppp_option_data *) data;
nb = odp->length;
if (cmd == PPPIOCGNPMODE) {
npi->mode = sc->sc_npmode[npx];
} else {
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if (npi->mode != sc->sc_npmode[npx]) {
sc->sc_npmode[npx] = npi->mode;
-/* $OpenBSD: if_pppoe.c,v 1.66 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.67 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
struct pppoediscparms *parms = (struct pppoediscparms *)data;
int len;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if (parms->eth_ifname[0] != '\0') {
struct ifnet *eth_if;
-/* $OpenBSD: if_spppsubr.c,v 1.173 2017/10/20 09:35:09 mpi Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.174 2018/02/19 08:59:52 mpi Exp $ */
/*
* Synchronous PPP link level subroutines.
*
spa->flags = auth->flags;
/* do not copy the secret, and only let root know the name */
- if (auth->name != NULL && suser(curproc, 0) == 0)
+ if (auth->name != NULL && suser(curproc) == 0)
strlcpy(spa->name, auth->name, sizeof(spa->name));
if (copyout(spa, (caddr_t)ifr->ifr_data, sizeof(*spa)) != 0) {
-/* $OpenBSD: if_switch.c,v 1.22 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_switch.c,v 1.23 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
switch (cmd) {
case SIOCBRDGADD:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = switch_port_add(sc, (struct ifbreq *)data);
break;
case SIOCBRDGDEL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = switch_port_del(sc, (struct ifbreq *)data);
break;
error = switch_port_list(sc, (struct ifbifconf *)data);
break;
case SIOCBRDGADDL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = switch_port_add(sc, (struct ifbreq *)data);
if (error && error != EEXIST)
-/* $OpenBSD: if_trunk.c,v 1.135 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.136 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
}
break;
case SIOCSTRUNK:
- if ((error = suser(curproc, 0)) != 0) {
+ if ((error = suser(curproc)) != 0) {
error = EPERM;
break;
}
trunk_port2req(tp, rp);
break;
case SIOCSTRUNKPORT:
- if ((error = suser(curproc, 0)) != 0) {
+ if ((error = suser(curproc)) != 0) {
error = EPERM;
break;
}
error = trunk_port_create(tr, tpif);
break;
case SIOCSTRUNKDELPORT:
- if ((error = suser(curproc, 0)) != 0) {
+ if ((error = suser(curproc)) != 0) {
error = EPERM;
break;
}
-/* $OpenBSD: if_vlan.c,v 1.175 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.176 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
int error;
- error = suser(curproc, 0);
+ error = suser(curproc);
if (error != 0)
return (error);
-/* $OpenBSD: pfkeyv2.c,v 1.175 2017/11/20 10:56:51 mpi Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.176 2018/02/19 08:59:52 mpi Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
headers);
/* Add ids only when we are root. */
- perm = suser(curproc, 0);
+ perm = suser(curproc);
if (perm == 0 && ipo->ipo_ids)
export_identities(&p, ipo->ipo_ids, 0, headers);
switch(w.w_op) {
case NET_KEY_SADB_DUMP:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
return (error);
NET_LOCK();
error = tdb_walk(rdomain, pfkeyv2_sysctl_walker, &w);
-/* $OpenBSD: ppp_tty.c,v 1.47 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: ppp_tty.c,v 1.48 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */
/*
struct ppp_softc *sc;
int error, s;
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
rw_enter_write(&ppp_pkt_init);
error = 0;
switch (cmd) {
case PPPIOCSASYNCMAP:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
sc->sc_asyncmap[0] = *(u_int *)data;
break;
break;
case PPPIOCSRASYNCMAP:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
sc->sc_rasyncmap = *(u_int *)data;
break;
break;
case PPPIOCSXASYNCMAP:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
s = spltty();
bcopy(data, sc->sc_asyncmap, sizeof(sc->sc_asyncmap));
-/* $OpenBSD: rtsock.c,v 1.261 2018/02/11 02:26:55 benno Exp $ */
+/* $OpenBSD: rtsock.c,v 1.262 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
* Verify that the caller has the appropriate privilege; RTM_GET
* is the only operation the non-superuser is allowed.
*/
- if (rtm->rtm_type != RTM_GET && suser(curproc, 0) != 0) {
+ if (rtm->rtm_type != RTM_GET && suser(curproc) != 0) {
error = EACCES;
goto fail;
}
-/* $OpenBSD: switchofp.c,v 1.69 2017/08/11 13:56:06 reyk Exp $ */
+/* $OpenBSD: switchofp.c,v 1.70 2018/02/19 08:59:52 mpi Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
sizeof(uint64_t));
break;
case SIOCSWSDPID:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
memcpy(&swofs->swofs_datapath_id, &bparam->ifbrp_datapath,
sizeof(uint64_t));
bparam->ifbrp_maxgroup = swofs->swofs_group_max_table;
break;
case SIOCSWSPORTNO:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
if (breq->ifbr_portno >= OFP_PORT_MAX)
-/* $OpenBSD: ieee80211_ioctl.c,v 1.58 2017/11/27 20:54:38 stsp Exp $ */
+/* $OpenBSD: ieee80211_ioctl.c,v 1.59 2018/02/19 08:59:52 mpi Exp $ */
/* $NetBSD: ieee80211_ioctl.c,v 1.15 2004/05/06 02:58:16 dyoung Exp $ */
/*-
error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd);
break;
case SIOCS80211NWID:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
if ((error = copyin(ifr->ifr_data, &nwid, sizeof(nwid))) != 0)
break;
error = copyout(&nwid, ifr->ifr_data, sizeof(nwid));
break;
case SIOCS80211NWKEY:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = ieee80211_ioctl_setnwkeys(ic, (void *)data);
break;
error = ieee80211_ioctl_getnwkeys(ic, (void *)data);
break;
case SIOCS80211WPAPARMS:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
error = ieee80211_ioctl_setwpaparms(ic, (void *)data);
break;
error = ieee80211_ioctl_getwpaparms(ic, (void *)data);
break;
case SIOCS80211WPAPSK:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
psk = (struct ieee80211_wpapsk *)data;
if (psk->i_enabled) {
psk->i_enabled = 0;
break;
case SIOCS80211KEYAVAIL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
ka = (struct ieee80211_keyavail *)data;
(void)ieee80211_pmksa_add(ic, IEEE80211_AKM_8021X,
ka->i_macaddr, ka->i_key, ka->i_lifetime);
break;
case SIOCS80211KEYRUN:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
kr = (struct ieee80211_keyrun *)data;
error = ieee80211_keyrun(ic, kr->i_macaddr);
ieee80211_disable_wep(ic);
break;
case SIOCS80211POWER:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
power = (struct ieee80211_power *)data;
ic->ic_lintval = power->i_maxsleep;
power->i_maxsleep = ic->ic_lintval;
break;
case SIOCS80211BSSID:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
bssid = (struct ieee80211_bssid *)data;
if (IEEE80211_ADDR_EQ(bssid->i_bssid, empty_macaddr))
}
break;
case SIOCS80211CHANNEL:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
chanreq = (struct ieee80211chanreq *)data;
if (chanreq->i_channel == IEEE80211_CHAN_ANY)
#endif
break;
case SIOCS80211TXPOWER:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
txpower = (struct ieee80211_txpower *)data;
if ((ic->ic_caps & IEEE80211_C_TXPMGT) == 0) {
ifp->if_mtu = ifr->ifr_mtu;
break;
case SIOCS80211SCAN:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
#ifndef IEEE80211_STA_ONLY
if (ic->ic_opmode == IEEE80211_M_HOSTAP)
ieee80211_node2req(ic, ni, nr);
break;
case SIOCS80211NODE:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
#ifndef IEEE80211_STA_ONLY
if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
break;
#ifndef IEEE80211_STA_ONLY
case SIOCS80211DELNODE:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
nr = (struct ieee80211_nodereq *)data;
ni = ieee80211_find_node(ic, nr->nr_macaddr);
ifr->ifr_flags = flags >> IEEE80211_F_USERSHIFT;
break;
case SIOCS80211FLAGS:
- if ((error = suser(curproc, 0)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
flags = (u_int32_t)ifr->ifr_flags << IEEE80211_F_USERSHIFT;
if (
-/* $OpenBSD: in_pcb.c,v 1.227 2017/12/04 13:40:34 bluhm Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.228 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
return (error);
} else {
if (in_rootonly(ntohs(lport), so->so_proto->pr_protocol) &&
- suser(p, 0) != 0)
+ suser(p) != 0)
return (EACCES);
}
if (nam) {
first = ipport_hifirstauto; /* sysctl */
last = ipport_hilastauto;
} else if (inp->inp_flags & INP_LOWPORT) {
- if (suser(p, 0))
+ if (suser(p))
return (EACCES);
first = IPPORT_RESERVED-1; /* 1023 */
last = 600; /* not IPPORT_RESERVED/2 */
-/* $OpenBSD: ip_carp.c,v 1.329 2018/02/07 11:30:01 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.330 2018/02/19 08:59:53 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
case SIOCSVH:
KERNEL_ASSERT_LOCKED(); /* touching carp_vhosts */
vhe = SRPL_FIRST_LOCKED(&sc->carp_vhosts);
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
break;
if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr)))
break;
}
carpr.carpr_advbase = sc->sc_advbase;
carpr.carpr_balancing = sc->sc_balancing;
- if (suser(p, 0) == 0)
+ if (suser(p) == 0)
bcopy(sc->sc_key, carpr.carpr_key,
sizeof(carpr.carpr_key));
carpr.carpr_peer.s_addr = sc->sc_peer.s_addr;
-/* $OpenBSD: ip_output.c,v 1.344 2017/11/22 12:28:49 bluhm Exp $ */
+/* $OpenBSD: ip_output.c,v 1.345 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
switch (optname) {
case IP_AUTH_LEVEL:
if (optval < IPSEC_AUTH_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
case IP_ESP_TRANS_LEVEL:
if (optval < IPSEC_ESP_TRANS_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
case IP_ESP_NETWORK_LEVEL:
if (optval < IPSEC_ESP_NETWORK_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
break;
case IP_IPCOMP_LEVEL:
if (optval < IPSEC_IPCOMP_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
/* needs privileges to switch when already set */
if (p->p_p->ps_rtableid != rtid &&
p->p_p->ps_rtableid != 0 &&
- (error = suser(p, 0)) != 0)
+ (error = suser(p)) != 0)
break;
/* table must exist */
if (!rtable_exists(rtid)) {
-/* $OpenBSD: ip6_input.c,v 1.213 2018/02/12 15:53:05 mpi Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.214 2018/02/19 08:59:53 mpi Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
uint8_t oldkey[IP6_SOIIKEY_LEN];
int error;
- error = suser(curproc, 0);
+ error = suser(curproc);
if (error != 0)
return (error);
-/* $OpenBSD: ip6_output.c,v 1.233 2018/02/11 00:24:13 dlg Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.234 2018/02/19 08:59:53 mpi Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
switch (optname) {
case IPV6_AUTH_LEVEL:
if (optval < IPSEC_AUTH_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
case IPV6_ESP_TRANS_LEVEL:
if (optval < IPSEC_ESP_TRANS_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
case IPV6_ESP_NETWORK_LEVEL:
if (optval < IPSEC_ESP_NETWORK_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
case IPV6_IPCOMP_LEVEL:
if (optval < IPSEC_IPCOMP_LEVEL_DEFAULT &&
- suser(p, 0)) {
+ suser(p)) {
error = EACCES;
break;
}
/* needs privileges to switch when already set */
if (p->p_p->ps_rtableid != rtid &&
p->p_p->ps_rtableid != 0 &&
- (error = suser(p, 0)) != 0)
+ (error = suser(p)) != 0)
break;
/* table must exist */
if (!rtable_exists(rtid)) {
* all multicast addresses. Only super user is allowed
* to do this.
*/
- if (suser(p, 0))
+ if (suser(p))
{
error = EACCES;
break;
}
mreq = mtod(m, struct ipv6_mreq *);
if (IN6_IS_ADDR_UNSPECIFIED(&mreq->ipv6mr_multiaddr)) {
- if (suser(p, 0))
+ if (suser(p))
{
error = EACCES;
break;
-/* $OpenBSD: nfs_syscalls.c,v 1.112 2018/01/31 14:41:31 mpi Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.113 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
#endif
/* Must be super user */
- error = suser(p, 0);
+ error = suser(p);
if (error)
return (error);
-/* $OpenBSD: ucred.h,v 1.11 2015/03/02 20:46:50 guenther Exp $ */
+/* $OpenBSD: ucred.h,v 1.12 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: ucred.h,v 1.12 1995/06/01 22:44:50 jtc Exp $ */
/*
#ifdef _KERNEL
#define crhold(cr) (cr)->cr_ref++
-#define SUSER_NOACCT 0x1 /* don't mark accounting flags */
-
int crfromxucred(struct ucred *, const struct xucred *);
void crset(struct ucred *, const struct ucred *);
struct ucred *crcopy(struct ucred *cr);
struct ucred *crdup(struct ucred *cr);
void crfree(struct ucred *cr);
struct ucred *crget(void);
-int suser(struct proc *p, u_int flags);
+int suser(struct proc *p);
int suser_ucred(struct ucred *cred);
#endif /* _KERNEL */
-/* $OpenBSD: ufs_quota.c,v 1.40 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: ufs_quota.c,v 1.41 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */
/*
break;
/* FALLTHROUGH */
default:
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
}
-/* $OpenBSD: uvm_mmap.c,v 1.146 2018/02/11 04:09:48 deraadt Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.147 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur)
return (EAGAIN);
#else
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
#endif
return (EINVAL); /* disallow wrap-around. */
#ifndef pmap_wired_count
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
#endif
return (EINVAL);
#ifndef pmap_wired_count
- if ((error = suser(p, 0)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
#endif
-/* $OpenBSD: uvm_swap.c,v 1.142 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.143 2018/02/19 08:59:53 mpi Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
}
/* all other requests require superuser privs. verify. */
- if ((error = suser(p, 0)) || (error = pledge_swapctl(p)))
+ if ((error = suser(p)) || (error = pledge_swapctl(p)))
goto out;
/*