libgslutil
1.2.3
|
Functions | |
int | usergroup_cgi (void) |
Set user/group for CGI program. More... | |
void | usergroup_cgi_or_die (void) |
Set user/group for CGI program, die on failure. More... | |
Support routines for manipulating user/group ID within CGI programs. Relies on an environment variable (REMOTE_USER
) set by the web server as per the CGI standard, and sets the user/group ID as appropriate (falling back to nobody
). Intended for running CGI programs as the logged-in user.
int usergroup_cgi | ( | void | ) |
Set user/group for CGI program.
-1 | on error (and see errno). |
0 | on success. |
Reads the environment variable REMOTE_USER
and sets the process's UID, GID and auxiliary groups based on its value. If REMOTE_USER
is not set, then it uses nobody
.
void usergroup_cgi_or_die | ( | void | ) |
Set user/group for CGI program, die on failure.
As per usergroup_cgi(), but always succeeds (or aborts the program).