#include "config.h"#include "shared/log.h"#include "shared/privdrop.h"#include "shared/status.h"#include <errno.h>#include <pwd.h>#include <grp.h>#include <ctype.h>#include <stdarg.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <sys/types.h>#include <syslog.h>#include <unistd.h>
Go to the source code of this file.
Defines | |
| #define | _GNU_SOURCE |
| #define | _SC_GETGR_R_SIZE_MAX 16384 |
Functions | |
| uid_t | privuid (const char *username) |
| gid_t | privgid (const char *groupname) |
| 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) |
| #define _GNU_SOURCE |
Privileges.
Definition at line 36 of file privdrop.c.
| #define _SC_GETGR_R_SIZE_MAX 16384 |
Definition at line 60 of file privdrop.c.
Referenced by privgid().
| void privclose | ( | const char * | username, | |
| const char * | groupname | |||
| ) |
| ods_status privdrop | ( | const char * | username, | |
| const char * | groupname, | |||
| const char * | newroot, | |||
| uid_t * | puid, | |||
| gid_t * | pgid | |||
| ) |
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 | ) |
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 the username.
Definition at line 71 of file privdrop.c.
References ods_log_error().
Referenced by privdrop().
1.7.1