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/svr4 | |
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/svr4')
-rw-r--r-- | sys/svr4/svr4_fcntl.c | 2 | ||||
-rw-r--r-- | sys/svr4/svr4_misc.c | 2 | ||||
-rw-r--r-- | sys/svr4/svr4_stat.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/sys/svr4/svr4_fcntl.c b/sys/svr4/svr4_fcntl.c index 9bd403c..b6e9b9a 100644 --- a/sys/svr4/svr4_fcntl.c +++ b/sys/svr4/svr4_fcntl.c @@ -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)) diff --git a/sys/svr4/svr4_misc.c b/sys/svr4/svr4_misc.c index 1d0065f..262fd06 100644 --- a/sys/svr4/svr4_misc.c +++ b/sys/svr4/svr4_misc.c @@ -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; diff --git a/sys/svr4/svr4_stat.c b/sys/svr4/svr4_stat.c index 99448ba..31cf8f0 100644 --- a/sys/svr4/svr4_stat.c +++ b/sys/svr4/svr4_stat.c @@ -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); |