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.
This commit is contained in:
parent
d5483ddfba
commit
f711d546d2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46112
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 @@ sioopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ sioopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ dgbopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ dgmopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -767,7 +767,7 @@ rcopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ rpopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ siopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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:
|
||||
|
@ -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 @@ sioopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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. */
|
||||
|
@ -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, ...
|
||||
|
@ -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++)
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 @@ dgbopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ dgmopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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 @@ sioopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 @@ STATIC int stliopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
}
|
||||
}
|
||||
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:
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -767,7 +767,7 @@ rcopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ rpopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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 @@ siopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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:
|
||||
|
@ -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)
|
||||
|
@ -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 @@ STATIC int stlopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
}
|
||||
}
|
||||
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:
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 @@ sioopen(dev, flag, mode, p)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 @@ execve(p, uap)
|
||||
* 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;
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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 @@ sysctl_root SYSCTL_HANDLER_ARGS
|
||||
/* 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)
|
||||
|
@ -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))))
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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. */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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 @@ DBPRINT(("access\n"));
|
||||
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 @@ DBPRINT(("setattr\n"));
|
||||
* 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)
|
||||
;
|
||||
|
@ -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, ...
|
||||
|
@ -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++)
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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. */
|
||||
|
14
sys/net/if.c
14
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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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 */
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user