summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus
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/pc98/cbus
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/pc98/cbus')
-rw-r--r--sys/pc98/cbus/fdc.c4
-rw-r--r--sys/pc98/cbus/sio.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c
index 7d6c8bb..5a5d338 100644
--- a/sys/pc98/cbus/fdc.c
+++ b/sys/pc98/cbus/fdc.c
@@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.53 1999/04/06 03:12:22 peter Exp $
+ * $Id: fd.c,v 1.54 1999/04/18 14:42:16 kato Exp $
*
*/
@@ -2717,7 +2717,7 @@ fdioctl(dev, cmd, addr, flag, p)
case FD_STYPE: /* set drive type */
/* this is considered harmful; only allow for superuser */
- if (suser(p->p_ucred, &p->p_acflag) != 0)
+ if (suser(p) != 0)
return EPERM;
*fd->ft = *(struct fd_type *)addr;
break;
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 1a788ed..8dec5d7 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sio.c,v 1.87 1999/04/19 11:11:01 kato Exp $
+ * $Id: sio.c,v 1.88 1999/04/19 16:10:40 kato Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@@ -1941,7 +1941,7 @@ open_top:
}
}
if (tp->t_state & TS_XCLUDE &&
- suser(p->p_ucred, &p->p_acflag)) {
+ suser(p)) {
error = EBUSY;
goto out;
}
@@ -2868,7 +2868,7 @@ sioioctl(dev, cmd, data, flag, p)
}
switch (cmd) {
case TIOCSETA:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
@@ -2961,7 +2961,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
@@ -3028,7 +3028,7 @@ sioioctl(dev, cmd, data, flag, p)
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p);
if (error != 0) {
splx(s);
return (error);
OpenPOWER on IntegriCloud