OpenDNSSEC-signer
1.4.8.2
|
#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 34 of file privdrop.c.
#define _SC_GETGR_R_SIZE_MAX 16384 |
Definition at line 58 of file privdrop.c.
Referenced by privgid().
#define _SC_GETPW_R_SIZE_MAX 16384 |
Definition at line 54 of file privdrop.c.
Referenced by privuid().
void privclose | ( | const char * | username, |
const char * | groupname | ||
) |
Close privdrop.
Definition at line 312 of file privdrop.c.
ods_status privdrop | ( | const char * | username, |
const char * | groupname, | ||
const char * | newroot, | ||
uid_t * | puid, | ||
gid_t * | pgid | ||
) |
Drop privileges.
Definition at line 155 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().
gid_t privgid | ( | const char * | groupname | ) |
Get the group identifier from the group name.
Definition at line 112 of file privdrop.c.
References _SC_GETGR_R_SIZE_MAX, and ods_log_error().
Referenced by engine_wakeup_workers(), and privdrop().
uid_t privuid | ( | const char * | username | ) |
Get the user identifier from the username.
Definition at line 69 of file privdrop.c.
References _SC_GETPW_R_SIZE_MAX, and ods_log_error().
Referenced by engine_wakeup_workers(), and privdrop().