diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2009-06-19 17:10:35 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2009-06-19 17:10:35 +0000 |
| commit | 838d9858251e9729d0b9c40b9aca89be3e171c1a (patch) | |
| tree | 851f3659dd95c07bf7aaf4a54cd53e83c804702d /sys/fs/unionfs | |
| parent | f345b422d1238f2bf7fa261da253223e74d21179 (diff) | |
Notes
Diffstat (limited to 'sys/fs/unionfs')
| -rw-r--r-- | sys/fs/unionfs/union_vnops.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 8505cacc8f1a..11671cb08ae0 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -638,7 +638,6 @@ unionfs_check_corrected_access(accmode_t accmode, uid_t uid; /* upper side vnode's uid */ gid_t gid; /* upper side vnode's gid */ u_short vmode; /* upper side vnode's mode */ - gid_t *gp; u_short mask; mask = 0; @@ -659,17 +658,14 @@ unionfs_check_corrected_access(accmode_t accmode, /* check group */ count = 0; - gp = cred->cr_groups; - for (; count < cred->cr_ngroups; count++, gp++) { - if (gid == *gp) { - if (accmode & VEXEC) - mask |= S_IXGRP; - if (accmode & VREAD) - mask |= S_IRGRP; - if (accmode & VWRITE) - mask |= S_IWGRP; - return ((vmode & mask) == mask ? 0 : EACCES); - } + if (groupmember(gid, cred)) { + if (accmode & VEXEC) + mask |= S_IXGRP; + if (accmode & VREAD) + mask |= S_IRGRP; + if (accmode & VWRITE) + mask |= S_IWGRP; + return ((vmode & mask) == mask ? 0 : EACCES); } /* check other */ |
