From f711d546d27edc6115841ef780df0252d44a996d Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 27 Apr 1999 11:18:52 +0000 Subject: Suser() simplification: 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in . 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 , but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code. --- sys/i386/isa/if_wl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/i386/isa/if_wl.c') diff --git a/sys/i386/isa/if_wl.c b/sys/i386/isa/if_wl.c index 42fc0f91bf82..33704771971a 100644 --- a/sys/i386/isa/if_wl.c +++ b/sys/i386/isa/if_wl.c @@ -1,4 +1,4 @@ -/* $Id: if_wl.c,v 1.19 1998/12/09 03:30:51 eivind Exp $ */ +/* $Id: if_wl.c,v 1.20 1999/01/12 00:36:31 eivind Exp $ */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1294,7 +1294,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* pointer to buffer in user space */ up = (void *)ifr->ifr_data; /* work out if they're root */ - isroot = (suser(p->p_ucred, &p->p_acflag) == 0); + isroot = (suser(p) == 0); for (i = 0; i < 0x40; i++) { /* don't hand the DES key out to non-root users */ @@ -1309,7 +1309,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* copy the PSA in from the caller; we only copy _some_ values */ case SIOCSWLPSA: /* root only */ - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) break; error = EINVAL; /* assume the worst */ /* pointer to buffer in user space containing data */ @@ -1363,7 +1363,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) */ case SIOCSWLCNWID: /* root only */ - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) break; if (!(ifp->if_flags & IFF_UP)) { error = EIO; /* only allowed while up */ @@ -1381,7 +1381,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* copy the EEPROM in 2.4 Gz WaveMODEM out to the caller */ case SIOCGWLEEPROM: /* root only */ - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) break; /* pointer to buffer in user space */ up = (void *)ifr->ifr_data; @@ -1404,7 +1404,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* zero (Delete) the wl cache */ case SIOCDWLCACHE: /* root only */ - if ((error = suser(p->p_ucred, &p->p_acflag))) + if ((error = suser(p))) break; wl_cache_zero(unit); break; -- cgit v1.2.3