xref: /freebsd/share/man/man9/groupmember.9 (revision b15110fb0dc6f0480482616f22bda3a2a19fbd80)
14772483cSRuslan Ermilov.\"
24772483cSRuslan Ermilov.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
375a45ca3SOlivier Certner.\" Copyright (C) 2023 Olivier Certner <olce.freebsd@certner.fr>
44772483cSRuslan Ermilov.\"
54772483cSRuslan Ermilov.\" Redistribution and use in source and binary forms, with or without
64772483cSRuslan Ermilov.\" modification, are permitted provided that the following conditions
74772483cSRuslan Ermilov.\" are met:
84772483cSRuslan Ermilov.\" 1. Redistributions of source code must retain the above copyright
94772483cSRuslan Ermilov.\"    notice(s), this list of conditions and the following disclaimer as
104772483cSRuslan Ermilov.\"    the first lines of this file unmodified other than the possible
114772483cSRuslan Ermilov.\"    addition of one or more copyright notices.
124772483cSRuslan Ermilov.\" 2. Redistributions in binary form must reproduce the above copyright
134772483cSRuslan Ermilov.\"    notice(s), this list of conditions and the following disclaimer in the
144772483cSRuslan Ermilov.\"    documentation and/or other materials provided with the distribution.
154772483cSRuslan Ermilov.\"
164772483cSRuslan Ermilov.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
174772483cSRuslan Ermilov.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
184772483cSRuslan Ermilov.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
194772483cSRuslan Ermilov.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
204772483cSRuslan Ermilov.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
214772483cSRuslan Ermilov.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
224772483cSRuslan Ermilov.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
234772483cSRuslan Ermilov.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
244772483cSRuslan Ermilov.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
254772483cSRuslan Ermilov.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
264772483cSRuslan Ermilov.\" DAMAGE.
274772483cSRuslan Ermilov.\"
28*b15110fbSOlivier Certner.Dd October 31, 2024
294772483cSRuslan Ermilov.Dt GROUPMEMBER 9
304772483cSRuslan Ermilov.Os
314772483cSRuslan Ermilov.Sh NAME
324772483cSRuslan Ermilov.Nm groupmember
3375a45ca3SOlivier Certner.Nd checks if credentials mandate some group membership
344772483cSRuslan Ermilov.Sh SYNOPSIS
354772483cSRuslan Ermilov.In sys/param.h
364772483cSRuslan Ermilov.In sys/ucred.h
37845b7c80SOlivier Certner.Ft bool
38*b15110fbSOlivier Certner.Fn groupmember "gid_t gid" "const struct ucred *cred"
39845b7c80SOlivier Certner.Ft bool
40*b15110fbSOlivier Certner.Fn realgroupmember "gid_t gid" "const struct ucred *cred"
414772483cSRuslan Ermilov.Sh DESCRIPTION
424772483cSRuslan ErmilovThe
434772483cSRuslan Ermilov.Fn groupmember
4475a45ca3SOlivier Certnerfunction checks if credentials
4575a45ca3SOlivier Certner.Fa cred
4675a45ca3SOlivier Certnerindicate that the associated subject or object is a member of the group
4775a45ca3SOlivier Certnerdesignated by the group ID
4875a45ca3SOlivier Certner.Fa gid .
494772483cSRuslan Ermilov.Pp
5075a45ca3SOlivier CertnerConsidered groups in
5175a45ca3SOlivier Certner.Fa cred
5275a45ca3SOlivier Certnerare the effective and supplementary groups.
5375a45ca3SOlivier CertnerThe real group is not taken into account.
545d9f3840SOlivier Certner.Pp
555d9f3840SOlivier CertnerFunction
565d9f3840SOlivier Certner.Fn realgroupmember
575d9f3840SOlivier Certnerworks the same except that it considers instead the real and supplementary
585d9f3840SOlivier Certnergroups, and not the effective one.
594772483cSRuslan Ermilov.Sh RETURN VALUES
60845b7c80SOlivier CertnerThe
61845b7c80SOlivier Certner.Fn groupmember
62845b7c80SOlivier Certnerand
63845b7c80SOlivier Certner.Fn realgroupmember
64845b7c80SOlivier Certnerfunctions return
65845b7c80SOlivier Certner.Dv true
66845b7c80SOlivier Certnerif the given credentials indicate membership of the group
67845b7c80SOlivier Certner.Fa gid ,
68845b7c80SOlivier Certneror
69845b7c80SOlivier Certner.Dv false
70845b7c80SOlivier Certnerotherwise.
7175a45ca3SOlivier Certner.Sh SEE ALSO
726e1fc011SGraham Percival.Xr getgroups 2 ,
7375a45ca3SOlivier Certner.Xr setgroups 2
744772483cSRuslan Ermilov.Sh AUTHORS
7575a45ca3SOlivier CertnerThis manual page was initially written by
7675a45ca3SOlivier Certner.An -nosplit
7775a45ca3SOlivier Certner.An Chad David Aq Mt davidc@acns.ab.ca
7875a45ca3SOlivier Certnerand was revised by
7975a45ca3SOlivier Certner.An Olivier Certner Aq Mt olce.freebsd@certner.fr .
80