OpenDNSSEC-signer 1.2.1
Functions

/build/buildd-opendnssec_1.2.1.dfsg-1-ia64-j6OroR/opendnssec-1.2.1.dfsg/signer/src/util/privdrop.h File Reference

#include <pwd.h>
#include <grp.h>
Include dependency graph for privdrop.h:

Go to the source code of this file.

Functions

gid_t privgid (const char *groupname)
uid_t privuid (const char *username)
int privdrop (const char *username, const char *groupname, const char *newroot)

Function Documentation

int privdrop ( const char *  username,
const char *  groupname,
const char *  newroot 
)

Drop privileges.

Parameters:
[in]usernamedrop priviliges to this user
[in]groupnamedrop priviliges to this group
[in]newrootmake this the new root directory
Returns:
0 on success, 1 on error.

Drop privileges.

Definition at line 148 of file privdrop.c.

References privgid(), privuid(), se_free(), se_log_debug(), se_log_error(), and se_malloc().

Referenced by tools_zone_fetcher().

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 109 of file privdrop.c.

References _SC_GETGR_R_SIZE_MAX, se_calloc(), and se_free().

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 70 of file privdrop.c.

References _SC_GETPW_R_SIZE_MAX, se_calloc(), and se_free().

Referenced by privdrop().