OpenDNSSEC-signer  1.3.9
Macros | Functions
privdrop.c File Reference
#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>
Include dependency graph for privdrop.c:

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)

Macro Definition Documentation

#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().


Function Documentation

void privclose ( const char *  username,
const char *  groupname 
)

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 
)
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().