Skip to content

setuidgid.8

Manvendra Bhangui edited this page Jan 8, 2026 · 9 revisions

NAME

setuidgid - run a program under a specified account's uid and gid.

SYNOPSIS

setuidgid [ -e ] [ -s ] [ -g groups] account child

DESCRIPTION

account is a single argument. child consists of one or more arguments.

-e
Set the environment variables HOME, USER and LOGNAME.

-s
Set supplementary group ids

-g groups
Set additional supplementary groups from a comma separated list of groups. groups can be numeric group IDs or group IDs from /etc/groups.

setuidgid(8) sets its uid and gid to account's uid and gid, removing all supplementary groups. It then runs child. If -s option is specified, setuidgid adds all supplementary groups for account in group(5) database. Additional groups can be supplied using -g option.

If -e option is passed, setuidgid(8) sets the environment variables USER and LOGNAME to account and the environment variable HOME to the home directory of account in the passwd(5) database.

setuidgid(8) cannot be run by anyone other than root.

EXIT CODES

setuidgid(8) exits 111 if it cannot find a UNIX account named account, if it cannot setgid, if it cannot setgroups, if it cannot setuid, if it cannot allocate memory or if it cannot run child. Otherwise its exit code is the same as that of child.

SEE ALSO

supervise(8), svc(8), svok(8), svstat(8), svscanboot(8), svscan(8), readproctitle(8), fghack(8), pgrphack(8), multilog(8), tai64n(8), tai64nlocal(8), group(5) envuidgid(8), envdir(8), softlimit(8), setlock(8) http://cr.yp.to/daemontools.html

Clone this wiki locally