You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manvendra Bhangui edited this page Jan 17, 2025
·
3 revisions
NAME
setuserid - set user identity
SYNTAX
#include <setuserid.h>
int setuserid(char* user, int supp, char *groups);
DESCRIPTION
setuserid sets the effective user ID, effective group ID of user user
using user ID, group ID from the passwd(5) database. It uses setuid(2)
to set the effective user ID, setgid(2) to set the effective gorup ID.
If supp is non zero, setgroups(2) is used to set supplementary groups
IDs from group(5) database. setuserid uses getpwnam(3), getgrent(3) to
fetch information form the passwd(5) and group(5) database. If QPWGR
environment variable is set, setuserid uses qgetpwnam(3), qgetgrent(3)
instead.
Additional supplementary groups can be specified as a comma separated
null terminated string of group IDs. The group IDS in groups can either
be numeric or group IDs from /etc/group.