diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1283,7 +1283,7 @@ /* * Returns whether gid designates a supplementary group in cred. */ -static int +static bool supplementary_group_member(gid_t gid, struct ucred *cred) { int l, h, m; @@ -1310,12 +1310,12 @@ * Check if gid is a member of the (effective) group set (i.e., effective and * supplementary groups). */ -int +bool groupmember(gid_t gid, struct ucred *cred) { - if (cred->cr_groups[0] == gid) - return (1); + if (gid == cred->cr_groups[0]) + return (true); return (supplementary_group_member(gid, cred)); } @@ -1324,11 +1324,11 @@ * Check if gid is a member of the real group set (i.e., real and supplementary * groups). */ -int +bool realgroupmember(gid_t gid, struct ucred *cred) { if (gid == cred->cr_rgid) - return (1); + return (true); return (supplementary_group_member(gid, cred)); } diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -159,8 +159,8 @@ void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int n, gid_t *groups); -int groupmember(gid_t gid, struct ucred *cred); -int realgroupmember(gid_t gid, struct ucred *cred); +bool groupmember(gid_t gid, struct ucred *cred); +bool realgroupmember(gid_t gid, struct ucred *cred); #endif /* _KERNEL */ #endif /* !_SYS_UCRED_H_ */