Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_prot.c
| Show First 20 Lines • Show All 1,262 Lines • ▼ Show 20 Lines | #ifdef REGRESSION | |||||||||
| } | } | |||||||||
| #else /* !REGRESSION */ | #else /* !REGRESSION */ | |||||||||
| return (ENOSYS); | return (ENOSYS); | |||||||||
| #endif /* REGRESSION */ | #endif /* REGRESSION */ | |||||||||
| } | } | |||||||||
| /* | /* | |||||||||
| * Check if gid is a member of the group set. | * Check if gid is a member of cred's group set. | |||||||||
| */ | */ | |||||||||
| int | int | |||||||||
| groupmember(gid_t gid, struct ucred *cred) | groupmember(gid_t gid, struct ucred *cred) | |||||||||
| { | { | |||||||||
| int l; | int l; | |||||||||
| int h; | int h; | |||||||||
| int m; | int m; | |||||||||
| if (cred->cr_groups[0] == gid) | if (cred->cr_groups[0] == gid) | |||||||||
| return(1); | return(1); | |||||||||
kib: Fix style while there? | ||||||||||
| /* | /* | |||||||||
| * If gid was not our primary group, perform a binary search | * If gid was not our primary group, perform a binary search | |||||||||
| * of the supplemental groups. This is possible because we | * of the supplemental groups. This is possible because we | |||||||||
| * sort the groups in crsetgroups(). | * sort the groups in crsetgroups(). | |||||||||
| */ | */ | |||||||||
| l = 1; | l = 1; | |||||||||
| h = cred->cr_ngroups; | h = cred->cr_ngroups; | |||||||||
| while (l < h) { | while (l < h) { | |||||||||
| m = l + ((h - l) / 2); | m = l + ((h - l) / 2); | |||||||||
| if (cred->cr_groups[m] < gid) | if (cred->cr_groups[m] < gid) | |||||||||
| l = m + 1; | l = m + 1; | |||||||||
| else | else | |||||||||
| h = m; | h = m; | |||||||||
| } | } | |||||||||
| if ((l < cred->cr_ngroups) && (cred->cr_groups[l] == gid)) | if ((l < cred->cr_ngroups) && (cred->cr_groups[l] == gid)) | |||||||||
kibUnsubmitted Not Done Inline Actions
kib: | ||||||||||
| return (1); | return (1); | |||||||||
| return (0); | return (0); | |||||||||
| } | } | |||||||||
| /* | /* | |||||||||
| * Test the active securelevel against a given level. securelevel_gt() | * Test the active securelevel against a given level. securelevel_gt() | |||||||||
| * implements (securelevel > level). securelevel_ge() implements | * implements (securelevel > level). securelevel_ge() implements | |||||||||
| ▲ Show 20 Lines • Show All 1,188 Lines • Show Last 20 Lines | ||||||||||
Fix style while there?