Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

mod_auth_dbm.c File Reference

#include "apr_want.h"
#include "apr_strings.h"
#include "apr_dbm.h"
#include "apr_md5.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"

Include dependency graph for mod_auth_dbm.c:

Go to the source code of this file.

Defines

#define APR_WANT_STRFUNC

Functions

static void * create_dbm_auth_dir_config (apr_pool_t *p, char *d)
static const char * set_dbm_slot (cmd_parms *cmd, void *offset, const char *f, const char *t)
static const char * set_dbm_type (cmd_parms *cmd, void *dir_config, const char *arg)
static char * get_dbm_pw (request_rec *r, char *user, char *auth_dbmpwfile, char *dbtype)
static char * get_dbm_grp (request_rec *r, char *user, char *auth_dbmgrpfile, char *dbtype)
static int dbm_authenticate_basic_user (request_rec *r)
static int dbm_check_auth (request_rec *r)
static void register_hooks (apr_pool_t *p)

Variables

static const command_rec dbm_auth_cmds []
module AP_MODULE_DECLARE_DATA auth_dbm_module


Define Documentation

#define APR_WANT_STRFUNC
 

Definition at line 31 of file mod_auth_dbm.c.


Function Documentation

static void* create_dbm_auth_dir_config apr_pool_t p,
char *  d
[static]
 

Definition at line 52 of file mod_auth_dbm.c.

References conf, and NULL.

static int dbm_authenticate_basic_user request_rec r  )  [static]
 

Definition at line 172 of file mod_auth_dbm.c.

References ap_get_module_config, APLOG_ERR, APLOG_MARK, APR_SUCCESS, auth_dbm_module, dbm_auth_config_rec::auth_dbmauthoritative, dbm_auth_config_rec::auth_dbmpwfile, dbm_auth_config_rec::auth_dbmtype, conf, DECLINED, get_dbm_pw(), HTTP_UNAUTHORIZED, and OK.

Referenced by register_hooks().

Here is the call graph for this function:

static int dbm_check_auth request_rec r  )  [static]
 

Definition at line 215 of file mod_auth_dbm.c.

References ap_get_module_config, AP_METHOD_BIT, APLOG_ERR, APLOG_MARK, auth_dbm_module, dbm_auth_config_rec::auth_dbmauthoritative, dbm_auth_config_rec::auth_dbmgrpfile, dbm_auth_config_rec::auth_dbmtype, conf, DECLINED, apr_array_header_t::elts, request_rec::filename, get_dbm_grp(), HTTP_UNAUTHORIZED, m, request_rec::method_number, nelts, NULL, OK, request_rec::per_dir_config, request_rec::pool, require_line::requirement, t, request_rec::user, and x.

Referenced by register_hooks().

Here is the call graph for this function:

static char* get_dbm_grp request_rec r,
char *  user,
char *  auth_dbmgrpfile,
char *  dbtype
[static]
 

Definition at line 153 of file mod_auth_dbm.c.

References get_dbm_pw(), and NULL.

Referenced by dbm_check_auth().

Here is the call graph for this function:

static char* get_dbm_pw request_rec r,
char *  user,
char *  auth_dbmpwfile,
char *  dbtype
[static]
 

Definition at line 108 of file mod_auth_dbm.c.

References APLOG_ERR, APLOG_MARK, APR_DBM_READONLY, APR_OS_DEFAULT, APR_SUCCESS, apr_datum_t::dptr, apr_datum_t::dsize, f, NULL, request_rec::pool, and pw.

Referenced by dbm_authenticate_basic_user(), and get_dbm_grp().

static void register_hooks apr_pool_t p  )  [static]
 

Definition at line 277 of file mod_auth_dbm.c.

References APR_HOOK_MIDDLE, dbm_authenticate_basic_user(), dbm_check_auth(), and NULL.

Here is the call graph for this function:

static const char* set_dbm_slot cmd_parms cmd,
void *  offset,
const char *  f,
const char *  t
[static]
 

Definition at line 64 of file mod_auth_dbm.c.

References DECLINE_CMD.

static const char* set_dbm_type cmd_parms cmd,
void *  dir_config,
const char *  arg
[static]
 

Definition at line 73 of file mod_auth_dbm.c.

References dbm_auth_config_rec::auth_dbmtype, conf, NULL, and cmd_parms_struct::pool.


Variable Documentation

module AP_MODULE_DECLARE_DATA auth_dbm_module
 

Initial value:

Definition at line 284 of file mod_auth_dbm.c.

Referenced by dbm_authenticate_basic_user(), and dbm_check_auth().

const command_rec dbm_auth_cmds[] [static]
 

Initial value:

{
    AP_INIT_TAKE1("AuthDBMUserFile", ap_set_file_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmpwfile),
     OR_AUTHCFG, "dbm database file containing user IDs and passwords"),
    AP_INIT_TAKE1("AuthDBMGroupFile", ap_set_file_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmgrpfile),
     OR_AUTHCFG, "dbm database file containing group names and member user IDs"),
    AP_INIT_TAKE12("AuthUserFile", set_dbm_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmpwfile),
     OR_AUTHCFG, NULL),
    AP_INIT_TAKE12("AuthGroupFile", set_dbm_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmgrpfile),
     OR_AUTHCFG, NULL),
    AP_INIT_TAKE1("AuthDBMType", set_dbm_type,
     NULL,
     OR_AUTHCFG, "what type of DBM file the user file is"),
    AP_INIT_FLAG("AuthDBMAuthoritative", ap_set_flag_slot,
     (void *)APR_OFFSETOF(dbm_auth_config_rec, auth_dbmauthoritative),
     OR_AUTHCFG, "Set to 'no' to allow access control to be passed along to lower modules, if the UserID is not known in this module"),
    {NULL}
}

Definition at line 83 of file mod_auth_dbm.c.