diff options
author | casper <none@none> | 2008-03-03 07:48:05 -0800 |
---|---|---|
committer | casper <none@none> | 2008-03-03 07:48:05 -0800 |
commit | ddf7fe95b8ad67aa16deb427a0b78f4dd4ff22b1 (patch) | |
tree | d61fb6e84331e6682c0c2fbd86826fc05b4edee1 /usr/src/uts/common/syscall/groups.c | |
parent | ea4b186bb8308ae1daf547212cb90881570ff943 (diff) | |
download | illumos-joyent-ddf7fe95b8ad67aa16deb427a0b78f4dd4ff22b1.tar.gz |
PSARC 2008/109 Fine Grained Access Permissions (FGAP)
6664443 Implement PSARC/2008/109
Diffstat (limited to 'usr/src/uts/common/syscall/groups.c')
-rw-r--r-- | usr/src/uts/common/syscall/groups.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/src/uts/common/syscall/groups.c b/usr/src/uts/common/syscall/groups.c index 8273171d0c..3a46812f8a 100644 --- a/usr/src/uts/common/syscall/groups.c +++ b/usr/src/uts/common/syscall/groups.c @@ -89,17 +89,24 @@ setgroups(int gidsetsize, gid_t *gidset) newcr = cralloc_ksid(); p = ttoproc(curthread); mutex_enter(&p->p_crlock); +retry: cr = p->p_cred; + crhold(cr); + mutex_exit(&p->p_crlock); if ((error = secpolicy_allow_setid(cr, -1, B_FALSE)) != 0) { - mutex_exit(&p->p_crlock); if (groups != NULL) kmem_free(groups, n * sizeof (gid_t)); if (ksl != NULL) ksidlist_rele(ksl); crfree(newcr); + crfree(cr); return (set_errno(error)); } + mutex_enter(&p->p_crlock); + crfree(cr); + if (cr != p->p_cred) + goto retry; crdup_to(cr, newcr); crsetsidlist(newcr, ksl); |