Functions

/build/buildd-opendnssec_1.3.2-1~bpo60+1-powerpc-mjESd6/opendnssec-1.3.2/signer/src/shared/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] username username
[in] groupname group name

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 
)

Drop privileges.

Parameters:
[in] username drop priviliges to this user
[in] groupname drop priviliges to this group
[in] newroot make this the new root directory
[out] puid user id
[out] pgid group id
Returns:
ods_status status.

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  ) 

Privileges. Get the group identifier from a group name.

Parameters:
[in] groupname group name
Returns:
gid_t group identifier

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 a username.

Parameters:
[in] username username
Returns:
uid_t user identifier

Get the user identifier from the username.

Definition at line 71 of file privdrop.c.

References ods_log_error().

Referenced by privdrop().