|
OpenDNSSEC-signer
1.3.9
|
#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.
Macros | |
| #define | _GNU_SOURCE /* defines for setres{g|u}id */ |
| #define | _SC_GETPW_R_SIZE_MAX 16384 |
| #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 /* defines for setres{g|u}id */ |
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().
| #define _SC_GETPW_R_SIZE_MAX 16384 |
Definition at line 56 of file privdrop.c.
Referenced by privuid().
| 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(), ODS_STATUS_CHROOT_ERR, ODS_STATUS_MALLOC_ERR, ODS_STATUS_OK, ODS_STATUS_PRIVDROP_ERR, 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 _SC_GETPW_R_SIZE_MAX, and ods_log_error().
Referenced by privdrop().
1.8.1.2