Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/groupmember.9
Show All 30 Lines | |||||
.Dt GROUPMEMBER 9 | .Dt GROUPMEMBER 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm groupmember | .Nm groupmember | ||||
.Nd checks if credentials mandate some group membership | .Nd checks if credentials mandate some group membership | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/ucred.h | .In sys/ucred.h | ||||
.Ft int | .Ft bool | ||||
.Fn groupmember "gid_t gid" "struct ucred *cred" | .Fn groupmember "gid_t gid" "struct ucred *cred" | ||||
.Ft int | .Ft bool | ||||
.Fn realgroupmember "gid_t gid" "struct ucred *cred" | .Fn realgroupmember "gid_t gid" "struct ucred *cred" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn groupmember | .Fn groupmember | ||||
function checks if credentials | function checks if credentials | ||||
.Fa cred | .Fa cred | ||||
indicate that the associated subject or object is a member of the group | indicate that the associated subject or object is a member of the group | ||||
designated by the group ID | designated by the group ID | ||||
.Fa gid . | .Fa gid . | ||||
.Pp | .Pp | ||||
Considered groups in | Considered groups in | ||||
.Fa cred | .Fa cred | ||||
are the effective and supplementary groups. | are the effective and supplementary groups. | ||||
The real group is not taken into account. | The real group is not taken into account. | ||||
.Pp | .Pp | ||||
Function | Function | ||||
.Fn realgroupmember | .Fn realgroupmember | ||||
works the same except that it considers instead the real and supplementary | works the same except that it considers instead the real and supplementary | ||||
groups, and not the effective one. | groups, and not the effective one. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
If the | The | ||||
.Fa gid | .Fn groupmember | ||||
is found, 1 is returned, otherwise 0. | and | ||||
.Fn realgroupmember | |||||
functions return | |||||
.Dv true | |||||
if the given credentials indicate membership of the group | |||||
.Fa gid , | |||||
or | |||||
.Dv false | |||||
otherwise. | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
mhorne: I think it is helpful to be explicit here. | |||||
.Xr getgroups 2 | .Xr getgroups 2 | ||||
.Xr setgroups 2 | .Xr setgroups 2 | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
This manual page was initially written by | This manual page was initially written by | ||||
.An -nosplit | .An -nosplit | ||||
.An Chad David Aq Mt davidc@acns.ab.ca | .An Chad David Aq Mt davidc@acns.ab.ca | ||||
and was revised by | and was revised by | ||||
.An Olivier Certner Aq Mt olce.freebsd@certner.fr . | .An Olivier Certner Aq Mt olce.freebsd@certner.fr . |
I think it is helpful to be explicit here.