#include <pwd.h>
#include <grp.h>
#include "shared/status.h"
Go to the source code of this file.
Functions | |
gid_t | privgid (const char *groupname) |
uid_t | privuid (const char *username) |
ods_status | privdrop (const char *username, const char *groupname, const char *newroot, uid_t *puid, gid_t *pgid) |
void | privclose (const char *username, const char *groupname) |
void privclose | ( | const char * | username, | |
const char * | groupname | |||
) |
Close privdrop.
[in] | username | username |
[in] | groupname | group name |
Close privdrop.
Definition at line 306 of file privdrop.c.
Referenced by tools_zone_fetcher().
ods_status privdrop | ( | const char * | username, | |
const char * | groupname, | |||
const char * | newroot, | |||
uid_t * | puid, | |||
gid_t * | pgid | |||
) |
Drop privileges.
[in] | username | drop priviliges to this user |
[in] | groupname | drop priviliges to this group |
[in] | newroot | make this the new root directory |
[out] | puid | user id |
[out] | pgid | group id |
Drop privileges.
Definition at line 149 of file privdrop.c.
References ods_log_debug(), ods_log_error(), privgid(), and privuid().
Referenced by tools_zone_fetcher().
gid_t privgid | ( | const char * | groupname | ) |
Privileges. Get the group identifier from a group name.
[in] | groupname | group name |
Get the group identifier from the group name.
Definition at line 110 of file privdrop.c.
References _SC_GETGR_R_SIZE_MAX, and ods_log_error().
Referenced by privdrop().
uid_t privuid | ( | const char * | username | ) |
Get the user identifier from a username.
[in] | username | username |
Get the user identifier from the username.
Definition at line 71 of file privdrop.c.
References ods_log_error().
Referenced by privdrop().