-
-
Notifications
You must be signed in to change notification settings - Fork 1
grpscan.3
Manvendra Bhangui edited this page Dec 31, 2023
·
2 revisions
grpscan - return array of groups to which the user belongs
#include <setuserid.h>
gid_t *grpscan(char *user, int *ngroups);
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.
setgroups(2) getgrent(3) setuserid(3), setuser_privileges(3),