Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
User and Group ID Services
Collaboration diagram for User and Group ID Services:

Macros

#define apr_uid_compare(left, right)   (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
 
#define apr_gid_compare(left, right)   (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
 

Typedefs

typedef uid_t apr_uid_t
 
typedef gid_t apr_gid_t
 

Functions

apr_status_t apr_uid_current (apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p)
 
apr_status_t apr_uid_name_get (char **username, apr_uid_t userid, apr_pool_t *p)
 
apr_status_t apr_uid_get (apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p)
 
apr_status_t apr_uid_homepath_get (char **dirname, const char *username, apr_pool_t *p)
 
apr_status_t apr_gid_name_get (char **groupname, apr_gid_t groupid, apr_pool_t *p)
 
apr_status_t apr_gid_get (apr_gid_t *groupid, const char *groupname, apr_pool_t *p)
 

Detailed Description

Macro Definition Documentation

#define apr_gid_compare (   left,
  right 
)    (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)

Compare two group identifiers for equality.

Parameters
leftOne gid to test
rightAnother gid to test
Returns
APR_SUCCESS if the apr_gid_t structures identify the same group, APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.
Remarks
This function is available only if APR_HAS_USER is defined.
#define apr_uid_compare (   left,
  right 
)    (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)

Compare two user identifiers for equality.

Parameters
leftOne uid to test
rightAnother uid to test
Returns
APR_SUCCESS if the apr_uid_t structures identify the same user, APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.
Remarks
This function is available only if APR_HAS_USER is defined.

Typedef Documentation

typedef gid_t apr_gid_t

Structure for determining group ownership.

typedef uid_t apr_uid_t

Structure for determining user ownership.

Function Documentation

apr_status_t apr_gid_get ( apr_gid_t groupid,
const char *  groupname,
apr_pool_t p 
)

Get the groupid for a specified group name

Parameters
groupidPointer to the group id (on output)
groupnameThe group name to look up
pThe pool from which to allocate the string
Remarks
This function is available only if APR_HAS_USER is defined.
apr_status_t apr_gid_name_get ( char **  groupname,
apr_gid_t  groupid,
apr_pool_t p 
)

Get the group name for a specified groupid

Parameters
groupnamePointer to new string containing group name (on output)
groupidThe groupid
pThe pool from which to allocate the string
Remarks
This function is available only if APR_HAS_USER is defined.
apr_status_t apr_uid_current ( apr_uid_t userid,
apr_gid_t groupid,
apr_pool_t p 
)

Get the userid (and groupid) of the calling process

Parameters
useridReturns the user id
groupidReturns the user's group id
pThe pool from which to allocate working space
Remarks
This function is available only if APR_HAS_USER is defined.
apr_status_t apr_uid_get ( apr_uid_t userid,
apr_gid_t groupid,
const char *  username,
apr_pool_t p 
)

Get the userid (and groupid) for the specified username

Parameters
useridReturns the user id
groupidReturns the user's group id
usernameThe username to look up
pThe pool from which to allocate working space
Remarks
This function is available only if APR_HAS_USER is defined.
apr_status_t apr_uid_homepath_get ( char **  dirname,
const char *  username,
apr_pool_t p 
)

Get the home directory for the named user

Parameters
dirnamePointer to new string containing directory name (on output)
usernameThe named user
pThe pool from which to allocate the string
Remarks
This function is available only if APR_HAS_USER is defined.
apr_status_t apr_uid_name_get ( char **  username,
apr_uid_t  userid,
apr_pool_t p 
)

Get the user name for a specified userid

Parameters
usernamePointer to new string containing user name (on output)
useridThe userid
pThe pool from which to allocate the string
Remarks
This function is available only if APR_HAS_USER is defined.