Skip to content

grpscan.3

Manvendra Bhangui edited this page Feb 25, 2024 · 4 revisions

NAME

grpscan - return array of groups to which the user belongs

SYNTAX

#include <setuserid.h>

gid_t *grpscan(char *user, int *ngroups);

DESCRIPTION

grpscan reads group(5) database for primary and supplementary groups to which user belongs and returns an gid_t array of ngroups. The return value and ngroups can be further used in a call to setgroups(2).

grpscan returns NULL on failure or gid_t array on success.

SEE ALSO

setgroups(2) getgrent(3) setuserid(3), setuser_privileges(3),

Clone this wiki locally