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/fs | |
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/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 10 | ||||
-rw-r--r-- | sys/fs/procfs/procfs.h | 5 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_mem.c | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 6 | ||||
-rw-r--r-- | sys/fs/umapfs/umap_vfsops.c | 4 |
6 files changed, 16 insertions, 17 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 06e3142..5507a1a 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.51 1999/01/31 11:54:29 bde Exp $ + * $Id: cd9660_vfsops.c,v 1.52 1999/04/18 10:58:02 dcs Exp $ */ #include <sys/param.h> @@ -239,7 +239,7 @@ cd9660_mount(mp, path, data, ndp, p) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p); if (error) - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p); if (error) { vput(devvp); return (error); diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 36aa91d..00f576b 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.80 1998/12/07 21:58:35 archie Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.81 1999/01/27 22:42:09 dillon Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -431,7 +431,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return (error); /* * We are very inconsistent about handling unsupported @@ -472,7 +472,7 @@ msdosfs_setattr(ap) gid = pmp->pm_gid; if ((cred->cr_uid != pmp->pm_uid || uid != pmp->pm_uid || (gid != pmp->pm_gid && !groupmember(gid, cred))) && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return error; if (uid != pmp->pm_uid || gid != pmp->pm_gid) return EINVAL; @@ -504,7 +504,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag)) && + (error = suser_xxx(cred, &ap->a_p->p_acflag)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_p)))) return (error); @@ -527,7 +527,7 @@ msdosfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != pmp->pm_uid && - (error = suser(cred, &ap->a_p->p_acflag))) + (error = suser_xxx(cred, &ap->a_p->p_acflag))) return (error); if (vp->v_type != VDIR) { /* We ignore the read and execute bits. */ diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index 619e1b2..180a47f 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/procfs/procfs.h @@ -37,7 +37,7 @@ * @(#)procfs.h 8.9 (Berkeley) 5/14/95 * * From: - * $Id: procfs.h,v 1.20 1998/07/07 04:08:44 bde Exp $ + * $Id: procfs.h,v 1.21 1999/01/05 03:53:06 peter Exp $ */ /* @@ -95,8 +95,7 @@ struct pfsnode { ((((p1)->p_cred->pc_ucred->cr_uid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_ruid == (p2)->p_cred->p_ruid) && \ ((p1)->p_cred->p_svuid == (p2)->p_cred->p_ruid) && \ - ((p2)->p_flag & P_SUGID) == 0) || \ - (suser((p1)->p_cred->pc_ucred, &(p1)->p_acflag) == 0)) + ((p2)->p_flag & P_SUGID) == 0) || (suser((p1)) == 0)) /* * Format of a directory entry in /proc, ... diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 22d8f74..4ca115f 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -37,7 +37,7 @@ * * @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 * - * $Id: procfs_mem.c,v 1.34 1998/07/15 02:32:19 bde Exp $ + * $Id: procfs_mem.c,v 1.35 1998/10/28 13:37:00 dg Exp $ */ /* @@ -331,7 +331,7 @@ int procfs_kmemaccess(curp) struct ucred *cred; cred = curp->p_cred->pc_ucred; - if (suser(cred, &curp->p_acflag)) + if (suser_xxx(cred, &curp->p_acflag)) return 1; for (i = 0; i < cred->cr_ngroups; i++) diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 1aa5453..ffab3e8 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.63 1999/01/05 03:53:06 peter Exp $ + * $Id: procfs_vnops.c,v 1.64 1999/01/27 22:42:07 dillon Exp $ */ /* @@ -246,12 +246,12 @@ procfs_ioctl(ap) break; case PIOCSFL: /* - * NFLAGS is "non-suser flags" -- currently, only + * NFLAGS is "non-suser_xxx flags" -- currently, only * PFS_ISUGID ("ignore set u/g id"); */ #define NFLAGS (PF_ISUGID) flags = (unsigned char)*(unsigned int*)ap->a_data; - if (flags & NFLAGS && (error = suser(p->p_ucred, &p->p_acflag))) + if (flags & NFLAGS && (error = suser(p))) return error; procp->p_pfsflags = flags; break; diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index 3ad41cf..3acc700 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $Id: umap_vfsops.c,v 1.23 1998/09/07 13:17:01 bde Exp $ + * $Id: umap_vfsops.c,v 1.24 1999/03/12 19:40:39 imp Exp $ */ /* @@ -98,7 +98,7 @@ umapfs_mount(mp, path, data, ndp, p) /* * Only for root */ - if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) + if ((error = suser(p)) != 0) return (error); #ifdef UMAPFS_DIAGNOSTIC |