diff options
author | phk <phk@FreeBSD.org> | 1999-04-27 11:18:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-04-27 11:18:52 +0000 |
commit | 16e3fbd2c114d665755299002f1c50dd11ba7245 (patch) | |
tree | d7f6bebfe177ae90b67d27603da4d211433088e5 /sys/i386/ibcs2 | |
parent | aba5e776bb95610ea3e3355cbf47aadb844773eb (diff) | |
download | FreeBSD-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/i386/ibcs2')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_misc.c | 6 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_socksys.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_sysi86.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 6cbb575..aff36c8 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -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)) { diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c index 0f5ee4d..16d964e 100644 --- a/sys/i386/ibcs2/ibcs2_socksys.c +++ b/sys/i386/ibcs2/ibcs2_socksys.c @@ -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 */ diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c index 210c268..bcc758b 100644 --- a/sys/i386/ibcs2/ibcs2_sysi86.c +++ b/sys/i386/ibcs2/ibcs2_sysi86.c @@ -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; |