Apache HTTPD
Classes | Macros | Enumerations | Functions | Variables
mod_privileges.c File Reference
#include <priv.h>
#include <sys/types.h>
#include <unistd.h>
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_log.h"
#include "mpm_common.h"
#include "ap_mpm.h"
#include "apr_strings.h"
#include "unixd.h"

Go to the source code of this file.

Classes

struct  priv_cfg
 
struct  priv_dir_cfg
 

Macros

#define CFG_CHECK(x)
 
#define CR_CHECK(x, y)
 
#define PDROP_CHECK(x)
 

Enumerations

enum  priv_mode { PRIV_UNSET , PRIV_FAST , PRIV_SECURE , PRIV_SELECTIVE }
 

Functions

static apr_status_t priv_cfg_cleanup (void *CFG)
 
static void * privileges_merge_cfg (apr_pool_t *pool, void *BASE, void *ADD)
 
static void * privileges_create_cfg (apr_pool_t *pool, server_rec *s)
 
static void * privileges_create_dir_cfg (apr_pool_t *pool, char *dummy)
 
static void * privileges_merge_dir_cfg (apr_pool_t *pool, void *BASE, void *ADD)
 
static apr_status_t privileges_end_req (void *data)
 
static int privileges_req (request_rec *r)
 
static int privileges_drop_first (apr_pool_t *pool, server_rec *s)
 
static int privileges_drop_last (apr_pool_t *pool, server_rec *s)
 
static apr_status_t privileges_term (void *rec)
 
static int privileges_postconf (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 
static int privileges_init (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 
static void privileges_hooks (apr_pool_t *pool)
 
static const charvhost_user (cmd_parms *cmd, void *dir, const char *arg)
 
static const charvhost_group (cmd_parms *cmd, void *dir, const char *arg)
 
static const charvhost_secure (cmd_parms *cmd, void *dir, int arg)
 
static const charvhost_cgimode (cmd_parms *cmd, void *dir, const char *arg)
 
static const chardtraceenable (cmd_parms *cmd, void *dir, int arg)
 
static const charprivs_mode (cmd_parms *cmd, void *dir, const char *arg)
 

Variables

static priv_set_tpriv_setid
 
static priv_set_tpriv_default = NULL
 
static int dtrace_enabled = 0
 
static const command_rec privileges_cmds []
 
static int *const aplog_module_index = &( privileges_module.module_index)
 

Macro Definition Documentation

◆ CFG_CHECK

#define CFG_CHECK (   x)
Value:
if ((x) == -1) { \
char msgbuf[128]; \
return apr_pstrdup(cmd->pool, msgbuf); \
}
apr_size_t size
apr_cmdtype_e cmd

Definition at line 32 of file mod_privileges.c.

◆ CR_CHECK

#define CR_CHECK (   x,
  y 
)
Value:
if (x == -1) \
"Failed to initialise privileges")
#define APLOG_MARK
Definition http_log.h:283
#define APLOG_CRIT
Definition http_log.h:66

Definition at line 37 of file mod_privileges.c.

◆ PDROP_CHECK

#define PDROP_CHECK (   x)
Value:
if (x == -1) { \
"Error dropping privileges"); \
return !OK; \
}
#define OK
Definition httpd.h:456
#define APLOGNO(n)
Definition http_log.h:117
const char * s
Definition apr_strings.h:95

Definition at line 306 of file mod_privileges.c.

Enumeration Type Documentation

◆ priv_mode

Enumerator
PRIV_UNSET 
PRIV_FAST 
PRIV_SECURE 
PRIV_SELECTIVE 

Definition at line 45 of file mod_privileges.c.

Function Documentation

◆ dtraceenable()

static const char * dtraceenable ( cmd_parms cmd,
void *  dir,
int  arg 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 479 of file mod_privileges.c.

◆ priv_cfg_cleanup()

static apr_status_t priv_cfg_cleanup ( void *  CFG)
static

Definition at line 63 of file mod_privileges.c.

◆ privileges_create_cfg()

static void * privileges_create_cfg ( apr_pool_t pool,
server_rec s 
)
static

Definition at line 79 of file mod_privileges.c.

◆ privileges_create_dir_cfg()

static void * privileges_create_dir_cfg ( apr_pool_t pool,
char dummy 
)
static

Definition at line 116 of file mod_privileges.c.

◆ privileges_drop_first()

static int privileges_drop_first ( apr_pool_t pool,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 312 of file mod_privileges.c.

◆ privileges_drop_last()

static int privileges_drop_last ( apr_pool_t pool,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 333 of file mod_privileges.c.

◆ privileges_end_req()

static apr_status_t privileges_end_req ( void *  data)
static

Definition at line 131 of file mod_privileges.c.

◆ privileges_hooks()

static void privileges_hooks ( apr_pool_t pool)
static

Definition at line 408 of file mod_privileges.c.

◆ privileges_init()

static int privileges_init ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptemp 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 389 of file mod_privileges.c.

◆ privileges_merge_cfg()

static void * privileges_merge_cfg ( apr_pool_t pool,
void *  BASE,
void *  ADD 
)
static

Definition at line 70 of file mod_privileges.c.

◆ privileges_merge_dir_cfg()

static void * privileges_merge_dir_cfg ( apr_pool_t pool,
void *  BASE,
void *  ADD 
)
static

Definition at line 122 of file mod_privileges.c.

◆ privileges_postconf()

static int privileges_postconf ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptemp,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 355 of file mod_privileges.c.

◆ privileges_req()

static int privileges_req ( request_rec r)
static

< Module declines to handle

< Module declines to handle

< Module has served the response completely * - it's safe to die() with no more output

< Module has handled this stage.

Definition at line 173 of file mod_privileges.c.

◆ privileges_term()

static apr_status_t privileges_term ( void *  rec)
static

Definition at line 350 of file mod_privileges.c.

◆ privs_mode()

static const char * privs_mode ( cmd_parms cmd,
void *  dir,
const char arg 
)
static

Definition at line 489 of file mod_privileges.c.

◆ vhost_cgimode()

static const char * vhost_cgimode ( cmd_parms cmd,
void *  dir,
const char arg 
)
static

Definition at line 453 of file mod_privileges.c.

◆ vhost_group()

static const char * vhost_group ( cmd_parms cmd,
void *  dir,
const char arg 
)
static

Definition at line 430 of file mod_privileges.c.

◆ vhost_secure()

static const char * vhost_secure ( cmd_parms cmd,
void *  dir,
int  arg 
)
static

Definition at line 441 of file mod_privileges.c.

◆ vhost_user()

static const char * vhost_user ( cmd_parms cmd,
void *  dir,
const char arg 
)
static

Definition at line 419 of file mod_privileges.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( privileges_module.module_index)
static

Definition at line 580 of file mod_privileges.c.

◆ dtrace_enabled

int dtrace_enabled = 0
static

Definition at line 61 of file mod_privileges.c.

◆ priv_default

priv_set_t* priv_default = NULL
static

Definition at line 60 of file mod_privileges.c.

◆ priv_setid

priv_set_t* priv_setid
static

Definition at line 59 of file mod_privileges.c.

◆ privileges_cmds

const command_rec privileges_cmds[]
static
Initial value:
= {
{ "VHostUser" , vhost_user , NULL , 128 , TAKE1, "Userid under which the virtualhost will run" },
{ "VHostGroup" , vhost_group , NULL , 128 , TAKE1, "Group under which the virtualhost will run" },
{ "VHostSecure" , vhost_secure , NULL , 128 , FLAG, "Run in enhanced security mode (default ON)" },
{ "VHostCGIMode" , vhost_cgimode , NULL , 128 , TAKE1, "Enable fork+exec for this virtualhost (Off|Secure|On)" },
{ "DTracePrivileges" , dtraceenable , NULL , 128 , FLAG, "Enable DTrace" },
{ "PrivilegesMode" , privs_mode , NULL , 128 | 64 , TAKE1, "tradeoff performance vs security (fast or secure)" },
{NULL}
}
@ TAKE1
Definition http_config.h:51
@ FLAG
Definition http_config.h:59
static const char * privs_mode(cmd_parms *cmd, void *dir, const char *arg)
static const char * vhost_secure(cmd_parms *cmd, void *dir, int arg)
static const char * vhost_group(cmd_parms *cmd, void *dir, const char *arg)
static const char * vhost_cgimode(cmd_parms *cmd, void *dir, const char *arg)
static const char * dtraceenable(cmd_parms *cmd, void *dir, int arg)
static const char * vhost_user(cmd_parms *cmd, void *dir, const char *arg)
return NULL
Definition mod_so.c:359

Definition at line 559 of file mod_privileges.c.