OpenDNSSEC-signer  1.4.5
Functions
privdrop.h File Reference
#include <pwd.h>
#include <grp.h>
#include "shared/status.h"
Include dependency graph for privdrop.h:
This graph shows which files directly or indirectly include this file:

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)

Function Documentation

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

Close privdrop.

Parameters
[in]usernameusername
[in]groupnamegroup name

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.

Parameters
[in]usernamedrop priviliges to this user
[in]groupnamedrop priviliges to this group
[in]newrootmake this the new root directory
[out]puiduser id
[out]pgidgroup id
Returns
ods_status status.

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)

Privileges. Get the group identifier from a group name.

Parameters
[in]groupnamegroup name
Returns
gid_t group identifier

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

uid_t privuid ( const char *  username)

Get the user identifier from a username.

Parameters
[in]usernameusername
Returns
uid_t user identifier

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