All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
rlm_files.c File Reference

Process simple 'users' policy files. More...

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <ctype.h>
#include <fcntl.h>
+ Include dependency graph for rlm_files.c:

Go to the source code of this file.

Data Structures

struct  rlm_files_t


#define READFILE(_x, _y)   do { if (getusersfile(inst, inst->_x, &inst->_y, inst->compat_mode) != 0) { ERROR("Failed reading %s", inst->_x); return -1;} } while (0)


typedef struct rlm_files_t rlm_files_t


static rlm_rcode_t CC_HINT (nonnull)
static int fall_through (VALUE_PAIR *vp)
static rlm_rcode_t file_common (rlm_files_t *inst, REQUEST *request, char const *filename, rbtree_t *tree, RADIUS_PACKET *request_packet, RADIUS_PACKET *reply_packet)
static int getusersfile (TALLOC_CTX *ctx, char const *filename, rbtree_t **ptree, char const *compat_mode_str)
static int mod_instantiate (UNUSED CONF_SECTION *conf, void *instance)
static int pairlist_cmp (void const *a, void const *b)


static const CONF_PARSER module_config []
module_t rlm_files

Detailed Description

Process simple 'users' policy files.


Definition in file rlm_files.c.

Data Structure Documentation

struct rlm_files_t

Definition at line 33 of file rlm_files.c.

+ Collaboration diagram for rlm_files_t:
Data Fields
rbtree_t * acctusers
char const * acctusersfile
rbtree_t * auth_users
char const * auth_usersfile
rbtree_t * common
char const * compat_mode
char const * filename
char const * key
rbtree_t * postauth_users
char const * postauth_usersfile
rbtree_t * postproxy_users
char const * postproxy_usersfile
rbtree_t * preproxy_users
char const * preproxy_usersfile
rbtree_t * users
char const * usersfile

Macro Definition Documentation

#define READFILE (   _x,
)    do { if (getusersfile(inst, inst->_x, &inst->_y, inst->compat_mode) != 0) { ERROR("Failed reading %s", inst->_x); return -1;} } while (0)

Typedef Documentation

typedef struct rlm_files_t rlm_files_t

Function Documentation

static rlm_rcode_t CC_HINT ( nonnull  )

Definition at line 463 of file rlm_files.c.

+ Here is the call graph for this function:

static int fall_through ( VALUE_PAIR vp)

Definition at line 73 of file rlm_files.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static rlm_rcode_t file_common ( rlm_files_t inst,
REQUEST request,
char const *  filename,
rbtree_t tree,
RADIUS_PACKET request_packet,
RADIUS_PACKET reply_packet 

Definition at line 345 of file rlm_files.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int getusersfile ( TALLOC_CTX *  ctx,
char const *  filename,
rbtree_t **  ptree,
char const *  compat_mode_str 

Definition at line 103 of file rlm_files.c.

+ Here is the call graph for this function:

static int mod_instantiate ( UNUSED CONF_SECTION conf,
void *  instance 

Definition at line 320 of file rlm_files.c.

static int pairlist_cmp ( void const *  a,
void const *  b 

Definition at line 97 of file rlm_files.c.

+ Here is the caller graph for this function:

Variable Documentation

const CONF_PARSER module_config[]
Initial value:
= {
{ FR_CONF_OFFSET("filename", PW_TYPE_FILE_INPUT, rlm_files_t, filename) },
{ FR_CONF_OFFSET("usersfile", PW_TYPE_FILE_INPUT, rlm_files_t, usersfile) },
{ FR_CONF_OFFSET("acctusersfile", PW_TYPE_FILE_INPUT, rlm_files_t, acctusersfile) },
{ FR_CONF_OFFSET("preproxy_usersfile", PW_TYPE_FILE_INPUT, rlm_files_t, preproxy_usersfile) },
{ FR_CONF_OFFSET("postproxy_usersfile", PW_TYPE_FILE_INPUT, rlm_files_t, postproxy_usersfile) },
{ FR_CONF_OFFSET("auth_usersfile", PW_TYPE_FILE_INPUT, rlm_files_t, auth_usersfile) },
{ FR_CONF_OFFSET("postauth_usersfile", PW_TYPE_FILE_INPUT, rlm_files_t, postauth_usersfile) },
File matching value must exist, and must be readable.
Definition: conffile.h:204
Definition: conffile.h:289
If a matching CONF_PAIR is found, error out with a deprecated message.
Definition: conffile.h:199
#define PW_TYPE_XLAT
string will be dynamically expanded.
Definition: conffile.h:207
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition: conffile.h:168
String of printable characters.
Definition: radius.h:33

Definition at line 81 of file rlm_files.c.

module_t rlm_files
Initial value:
= {
.name = "files",
.inst_size = sizeof(rlm_files_t),
.config = module_config,
.instantiate = mod_instantiate,
.methods = {
[MOD_PREACCT] = mod_preacct,
[MOD_PRE_PROXY] = mod_pre_proxy,
[MOD_POST_PROXY] = mod_post_proxy,
5 methods index for preproxy section.
Definition: modules.h:46
static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request) CC_HINT(nonnull)
7 methods index for postauth section.
Definition: modules.h:48
static rlm_rcode_t mod_authorize(void *instance, REQUEST *request)
Handle authorization requests using Couchbase document data.
Definition: modules.h:86
Will be restarted on HUP.
Definition: modules.h:79
static rlm_rcode_t mod_authenticate(void *instance, REQUEST *request) CC_HINT(nonnull)
0 methods index for authenticate section.
Definition: modules.h:41
static int mod_instantiate(UNUSED CONF_SECTION *conf, void *instance)
Definition: rlm_files.c:320
6 methods index for postproxy section.
Definition: modules.h:47
2 methods index for preacct section.
Definition: modules.h:43
struct rlm_files_t rlm_files_t
static const CONF_PARSER module_config[]
Definition: rlm_files.c:81
1 methods index for authorize section.
Definition: modules.h:42

Definition at line 528 of file rlm_files.c.