diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-08-20 08:36:26 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-08-20 08:36:26 +0000 |
| commit | e39c53eda5e3e8f92d5357892ca760d1becbbc01 (patch) | |
| tree | 5ada3f2e7b8e39391ffa62c2e389efa54be3678f /sys/fs/hpfs | |
| parent | a89321725818aa162b27016957422fc47a17e940 (diff) | |
Notes
Diffstat (limited to 'sys/fs/hpfs')
| -rw-r--r-- | sys/fs/hpfs/hpfs_vnops.c | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c index 4ab248c57669..4f5a7354c665 100644 --- a/sys/fs/hpfs/hpfs_vnops.c +++ b/sys/fs/hpfs/hpfs_vnops.c @@ -777,10 +777,7 @@ hpfs_access(ap) { struct vnode *vp = ap->a_vp; struct hpfsnode *hp = VTOHP(vp); - struct ucred *cred = ap->a_cred; - mode_t mask, mode = ap->a_mode; - register gid_t *gp; - int i; + mode_t mode = ap->a_mode; dprintf(("hpfs_access(0x%x):\n", hp->h_no)); @@ -800,43 +797,8 @@ hpfs_access(ap) } } - /* Otherwise, user id 0 always gets access. */ - if (cred->cr_uid == 0) - return (0); - - mask = 0; - - /* Otherwise, check the owner. */ - if (cred->cr_uid == hp->h_uid) { - if (mode & VEXEC) - mask |= S_IXUSR; - if (mode & VREAD) - mask |= S_IRUSR; - if (mode & VWRITE) - mask |= S_IWUSR; - return ((hp->h_mode & mask) == mask ? 0 : EACCES); - } - - /* Otherwise, check the groups. */ - for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++) - if (hp->h_gid == *gp) { - if (mode & VEXEC) - mask |= S_IXGRP; - if (mode & VREAD) - mask |= S_IRGRP; - if (mode & VWRITE) - mask |= S_IWGRP; - return ((hp->h_mode & mask) == mask ? 0 : EACCES); - } - - /* Otherwise, check everyone else. */ - if (mode & VEXEC) - mask |= S_IXOTH; - if (mode & VREAD) - mask |= S_IROTH; - if (mode & VWRITE) - mask |= S_IWOTH; - return ((hp->h_mode & mask) == mask ? 0 : EACCES); + return (vaccess(vp->v_type, hp->h_mode, hp->h_uid, hp->h_gid, + ap->a_mode, ap->a_cred)); } /* |
