summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
committerphk <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
commit16e3fbd2c114d665755299002f1c50dd11ba7245 (patch)
treed7f6bebfe177ae90b67d27603da4d211433088e5 /sys/dev
parentaba5e776bb95610ea3e3355cbf47aadb844773eb (diff)
downloadFreeBSD-src-16e3fbd2c114d665755299002f1c50dd11ba7245.zip
FreeBSD-src-16e3fbd2c114d665755299002f1c50dd11ba7245.tar.gz
Suser() simplification:
1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/atapi-cd.c4
-rw-r--r--sys/dev/cy/cy.c8
-rw-r--r--sys/dev/cy/cy_isa.c8
-rw-r--r--sys/dev/dgb/dgb.c8
-rw-r--r--sys/dev/dgb/dgm.c8
-rw-r--r--sys/dev/en/midway.c4
-rw-r--r--sys/dev/fdc/fdc.c4
-rw-r--r--sys/dev/rc/rc.c4
-rw-r--r--sys/dev/rp/rp.c8
-rw-r--r--sys/dev/si/si.c12
-rw-r--r--sys/dev/sio/sio.c8
-rw-r--r--sys/dev/snp/snp.c2
-rw-r--r--sys/dev/syscons/syscons.c6
-rw-r--r--sys/dev/vinum/vinum.c4
-rw-r--r--sys/dev/vn/vn.c4
-rw-r--r--sys/dev/wl/if_wl.c12
16 files changed, 52 insertions, 52 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index ad712e7..38581cb 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.4 1999/03/28 18:57:19 sos Exp $
+ * $Id: atapi-cd.c,v 1.5 1999/04/10 18:53:35 sos Exp $
*/
#include "ata.h"
@@ -510,7 +510,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p)
return acd_lock_device(cdp, 1);
case CDIOCRESET:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return error;
return acd_test_unit_ready(cdp);
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index e513c05..6947d09 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.85 1999/01/30 12:17:33 phk Exp $
+ * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $
*/
#include "opt_compat.h"
@@ -718,7 +718,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1623,7 +1623,7 @@ sioioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1722,7 +1722,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index e513c05..6947d09 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.85 1999/01/30 12:17:33 phk Exp $
+ * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $
*/
#include "opt_compat.h"
@@ -718,7 +718,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1623,7 +1623,7 @@ sioioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1722,7 +1722,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c
index 1e53116..c640622 100644
--- a/sys/dev/dgb/dgb.c
+++ b/sys/dev/dgb/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.43 1999/03/13 13:20:54 joerg Exp $
+ * dgb.c $Id: dgb.c,v 1.44 1999/04/22 15:19:37 davidn Exp $
*
* Digiboard driver.
*
@@ -1034,7 +1034,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1579,7 +1579,7 @@ dgbioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1801,7 +1801,7 @@ dgbioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/dev/dgb/dgm.c b/sys/dev/dgb/dgm.c
index 68ef91c..97ff12f 100644
--- a/sys/dev/dgb/dgm.c
+++ b/sys/dev/dgb/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.7 1999/01/30 12:17:32 phk Exp $
+ * $Id: dgm.c,v 1.8 1999/04/11 03:47:24 eivind Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -834,7 +834,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1378,7 +1378,7 @@ dgmioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1600,7 +1600,7 @@ dgmioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index d462c4f..a3db462 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -1262,7 +1262,7 @@ caddr_t data;
#ifdef ATM_PVCEXT
case SIOCSPVCTX:
- if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) == 0)
+ if ((error = suser(curproc)) == 0)
error = en_pvctx(sc, (struct pvctxreq *)data);
break;
@@ -1274,7 +1274,7 @@ caddr_t data;
do {
struct ifnet *shadow;
- if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) != 0)
+ if ((error = suser(curproc)) != 0)
break;
if ((shadow = pvc_attach(ifp)) != NULL) {
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 0414b18..d465911 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.134 1999/04/06 03:06:51 peter Exp $
+ * $Id: fd.c,v 1.135 1999/04/16 21:22:19 peter Exp $
*
*/
@@ -2299,7 +2299,7 @@ fdioctl(dev, cmd, addr, flag, p)
case FD_STYPE: /* set drive type */
/* this is considered harmful; only allow for superuser */
- if (suser(p->p_ucred, &p->p_acflag) != 0)
+ if (suser(p) != 0)
return EPERM;
*fd->ft = *(struct fd_type *)addr;
break;
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index a5d96ec..ca9032e 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -767,7 +767,7 @@ again:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1144,7 +1144,7 @@ struct proc *p;
break;
case TIOCMSDTRWAIT:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index 9a95809..39972dd 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: $
+ * $Id: rp.c,v 1.23 1999/04/24 20:26:12 billf Exp $
*/
/*
@@ -1341,7 +1341,7 @@ open_top:
}
}
if(tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
splx(oldspl);
return(EBUSY);
}
@@ -1614,7 +1614,7 @@ rpioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if(error != 0)
return(error);
*ct = *(struct termios *)data;
@@ -1759,7 +1759,7 @@ rpioctl(dev, cmd, data, flag, p)
*(int *)data = result;
break;
case TIOCMSDTRWAIT:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if(error != 0) {
splx(oldspl);
return(error);
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 7dae243..670ef14 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.79 1999/01/30 12:17:34 phk Exp $
+ * $Id: si.c,v 1.80 1999/04/24 20:17:03 peter Exp $
*/
#ifndef lint
@@ -1132,7 +1132,7 @@ siopen(dev, flag, mode, p)
/* quickly let in /dev/si_control */
if (IS_CONTROLDEV(mynor)) {
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
return(error);
return(0);
}
@@ -1210,7 +1210,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
DPRINT((pp, DBG_OPEN|DBG_FAIL,
"already open and EXCLUSIVE set\n"));
error = EBUSY;
@@ -1525,7 +1525,7 @@ siioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1635,7 +1635,7 @@ siioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
goto outspl;
}
@@ -1692,7 +1692,7 @@ si_Sioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ip = (int *)data;
-#define SUCHECK if ((error = suser(p->p_ucred, &p->p_acflag))) goto out
+#define SUCHECK if ((error = suser(p))) goto out
switch (cmd) {
case TCSIPORTS:
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index dc42b0a..4c62ca9 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sio.c,v 1.226 1999/04/18 14:35:28 peter Exp $
+ * $Id: sio.c,v 1.227 1999/04/24 10:41:21 dt Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@@ -1207,7 +1207,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -1862,7 +1862,7 @@ sioioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -1953,7 +1953,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 686aa27..0a1438d 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -291,7 +291,7 @@ snpopen(dev, flag, mode, p)
struct snoop *snp;
register int unit, error;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = suser(p)) != 0)
return (error);
if ((unit = minor(dev)) >= NSNP)
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index a2db9b4..1f8377e 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.299 1999/03/10 10:36:53 yokota Exp $
+ * $Id: syscons.c,v 1.300 1999/04/16 21:21:56 peter Exp $
*/
#include "sc.h"
@@ -709,7 +709,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
mouse_level = 0; /* XXX */
}
else
- if (tp->t_state & TS_XCLUDE && suser(p->p_ucred, &p->p_acflag))
+ if (tp->t_state & TS_XCLUDE && suser(p))
return(EBUSY);
if (minor(dev) < MAXCONS && !console[minor(dev)]) {
console[minor(dev)] = alloc_scp();
@@ -1537,7 +1537,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case KDENABIO: /* allow io operations */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return error;
if (securelevel > 0)
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index d2389da..86c8fc0 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinum.c,v 1.24 1999/03/19 05:35:25 grog Exp grog $
+ * $Id: vinum.c,v 1.17 1999/04/17 04:15:50 grog Exp $
*/
#define STATIC static /* nothing while we're testing XXX */
@@ -347,7 +347,7 @@ vinumopen(dev_t dev,
return ENODEV; /* don't know what to do with these */
case VINUM_SUPERDEV_TYPE:
- error = suser(p->p_ucred, &p->p_acflag); /* are we root? */
+ error = suser(p); /* are we root? */
if (error == 0) { /* yes, can do */
if (dev == VINUM_DAEMON_DEV) /* daemon device */
vinum_conf.flags |= VF_DAEMONOPEN; /* we're open */
diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c
index d4e2440..11cbd01 100644
--- a/sys/dev/vn/vn.c
+++ b/sys/dev/vn/vn.c
@@ -38,7 +38,7 @@
* from: Utah Hdr: vn.c 1.13 94/04/02
*
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
- * $Id: vn.c,v 1.74 1999/02/01 08:36:02 dillon Exp $
+ * $Id: vn.c,v 1.75 1999/03/14 09:20:00 julian Exp $
*/
/*
@@ -409,7 +409,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
vn_specific:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error)
return (error);
diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c
index 42fc0f9..3370477 100644
--- a/sys/dev/wl/if_wl.c
+++ b/sys/dev/wl/if_wl.c
@@ -1,4 +1,4 @@
-/* $Id: if_wl.c,v 1.19 1998/12/09 03:30:51 eivind Exp $ */
+/* $Id: if_wl.c,v 1.20 1999/01/12 00:36:31 eivind Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1294,7 +1294,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* pointer to buffer in user space */
up = (void *)ifr->ifr_data;
/* work out if they're root */
- isroot = (suser(p->p_ucred, &p->p_acflag) == 0);
+ isroot = (suser(p) == 0);
for (i = 0; i < 0x40; i++) {
/* don't hand the DES key out to non-root users */
@@ -1309,7 +1309,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* copy the PSA in from the caller; we only copy _some_ values */
case SIOCSWLPSA:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
error = EINVAL; /* assume the worst */
/* pointer to buffer in user space containing data */
@@ -1363,7 +1363,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
*/
case SIOCSWLCNWID:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
if (!(ifp->if_flags & IFF_UP)) {
error = EIO; /* only allowed while up */
@@ -1381,7 +1381,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* copy the EEPROM in 2.4 Gz WaveMODEM out to the caller */
case SIOCGWLEEPROM:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
/* pointer to buffer in user space */
up = (void *)ifr->ifr_data;
@@ -1404,7 +1404,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* zero (Delete) the wl cache */
case SIOCDWLCACHE:
/* root only */
- if ((error = suser(p->p_ucred, &p->p_acflag)))
+ if ((error = suser(p)))
break;
wl_cache_zero(unit);
break;
OpenPOWER on IntegriCloud