The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
rlm_unix.c File Reference

Unixy things. More...

#include <freeradius-devel/radius/radius.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/sysutmp.h>
#include <freeradius-devel/util/perm.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <grp.h>
#include <pwd.h>
#include <sys/stat.h>
#include "config.h"
+ Include dependency graph for rlm_unix.c:

Go to the source code of this file.

Data Structures

struct  rlm_unix_t
 

Macros

#define ENC(c)   trans[c]
 
#define LOG_PREFIX   mctx->mi->name
 

Functions

static unlang_action_t mod_accounting (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t mod_authorize (rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
 
static int mod_bootstrap (module_inst_ctx_t const *mctx)
 
static bool unix_check_group (UNUSED rlm_unix_t const *inst, request_t *request, char const *name)
 Check if the user is in the given group. More...
 
static xlat_action_t unix_group_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Check if the user is a member of a particular unix group. More...
 
static char * uue (void *in)
 

Variables

static fr_dict_attr_t const * attr_acct_delay_time
 
static fr_dict_attr_t const * attr_acct_status_type
 
static fr_dict_attr_t const * attr_auth_type
 
static fr_dict_attr_t const * attr_crypt_password
 
static fr_dict_attr_t const * attr_expr_bool_enum
 
static fr_dict_attr_t const * attr_framed_ip_address
 
static fr_dict_attr_t const * attr_framed_protocol
 
static fr_dict_attr_t const * attr_login_ip_host
 
static fr_dict_attr_t const * attr_nas_ip_address
 
static fr_dict_attr_t const * attr_nas_port
 
static fr_dict_attr_t const * attr_user_name
 
static fr_dict_t const * dict_freeradius
 
static fr_dict_t const * dict_radius
 
static const conf_parser_t module_config []
 
module_rlm_t rlm_unix
 
fr_dict_autoload_t rlm_unix_dict []
 
fr_dict_attr_autoload_t rlm_unix_dict_attr []
 
static char trans [64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 

Detailed Description

Unixy things.

Id
a66913ce637742e487bb83adf444be9da014964f

Definition in file rlm_unix.c.


Data Structure Documentation

◆ rlm_unix_t

struct rlm_unix_t

Definition at line 51 of file rlm_unix.c.

Data Fields
char const * radwtmp

Macro Definition Documentation

◆ ENC

#define ENC (   c)    trans[c]

Definition at line 49 of file rlm_unix.c.

◆ LOG_PREFIX

#define LOG_PREFIX   mctx->mi->name

Definition at line 29 of file rlm_unix.c.

Function Documentation

◆ mod_accounting()

static unlang_action_t mod_accounting ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 373 of file rlm_unix.c.

+ Here is the call graph for this function:

◆ mod_authorize()

static unlang_action_t mod_authorize ( rlm_rcode_t p_result,
UNUSED module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 221 of file rlm_unix.c.

+ Here is the call graph for this function:

◆ mod_bootstrap()

static int mod_bootstrap ( module_inst_ctx_t const *  mctx)
static

Definition at line 183 of file rlm_unix.c.

+ Here is the call graph for this function:

◆ unix_check_group()

static bool unix_check_group ( UNUSED rlm_unix_t const *  inst,
request_t request,
char const *  name 
)
static

Check if the user is in the given group.

Definition at line 101 of file rlm_unix.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uue()

static char* uue ( void *  in)
static

Definition at line 346 of file rlm_unix.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ attr_acct_delay_time

fr_dict_attr_t const* attr_acct_delay_time
static

Definition at line 79 of file rlm_unix.c.

◆ attr_acct_status_type

fr_dict_attr_t const* attr_acct_status_type
static

Definition at line 78 of file rlm_unix.c.

◆ attr_auth_type

fr_dict_attr_t const* attr_auth_type
static

Definition at line 70 of file rlm_unix.c.

◆ attr_crypt_password

fr_dict_attr_t const* attr_crypt_password
static

Definition at line 71 of file rlm_unix.c.

◆ attr_expr_bool_enum

fr_dict_attr_t const* attr_expr_bool_enum
static

Definition at line 80 of file rlm_unix.c.

◆ attr_framed_ip_address

fr_dict_attr_t const* attr_framed_ip_address
static

Definition at line 74 of file rlm_unix.c.

◆ attr_framed_protocol

fr_dict_attr_t const* attr_framed_protocol
static

Definition at line 75 of file rlm_unix.c.

◆ attr_login_ip_host

fr_dict_attr_t const* attr_login_ip_host
static

Definition at line 73 of file rlm_unix.c.

◆ attr_nas_ip_address

fr_dict_attr_t const* attr_nas_ip_address
static

Definition at line 76 of file rlm_unix.c.

◆ attr_nas_port

fr_dict_attr_t const* attr_nas_port
static

Definition at line 77 of file rlm_unix.c.

◆ attr_user_name

fr_dict_attr_t const* attr_user_name
static

Definition at line 72 of file rlm_unix.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 60 of file rlm_unix.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 61 of file rlm_unix.c.

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:627
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:256
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
Definition: cf_parse.h:411

Definition at line 55 of file rlm_unix.c.

◆ rlm_unix

module_rlm_t rlm_unix
Initial value:
= {
.common = {
.name = "unix",
.inst_size = sizeof(rlm_unix_t),
.bootstrap = mod_bootstrap
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("accounting", CF_IDENT_ANY), .method = mod_accounting },
{ .section = SECTION_NAME("recv", "Access-Request"), .method = mod_authorize },
{ .section = SECTION_NAME("send", "Accounting-Response"), .method = mod_accounting },
}
}
}
#define CF_IDENT_ANY
Definition: cf_util.h:78
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
static const conf_parser_t config[]
Definition: base.c:183
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Definition: rlm_unix.c:183
static unlang_action_t mod_accounting(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition: rlm_unix.c:373
static const conf_parser_t module_config[]
Definition: rlm_unix.c:55
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
Definition: rlm_unix.c:221
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
Definition: section.h:40
@ MODULE_TYPE_THREAD_UNSAFE
Module is not threadsafe.
Definition: module.h:48
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Definition: module.h:151
Named methods exported by a module.
Definition: module.h:173

Definition at line 554 of file rlm_unix.c.

◆ rlm_unix_dict

fr_dict_autoload_t rlm_unix_dict
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_freeradius
Definition: rlm_unix.c:60
static fr_dict_t const * dict_radius
Definition: rlm_unix.c:61

Definition at line 64 of file rlm_unix.c.

◆ rlm_unix_dict_attr

fr_dict_attr_autoload_t rlm_unix_dict_attr
Initial value:
= {
{ .out = &attr_auth_type, .name = "Auth-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
{ .out = &attr_crypt_password, .name = "Password.Crypt", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ .out = &attr_user_name, .name = "User-Name", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ .out = &attr_login_ip_host, .name = "Login-IP-Host", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_framed_ip_address, .name = "Framed-IP-Address", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_framed_protocol, .name = "Framed-Protocol", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_nas_ip_address, .name = "NAS-IP-Address", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_nas_port, .name = "NAS-Port", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_acct_status_type, .name = "Acct-Status-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_acct_delay_time, .name = "Acct-Delay-Time", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_expr_bool_enum, .name = "Expr-Bool-Enum", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
{ NULL }
}
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
Definition: merged_model.c:86
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
@ FR_TYPE_BOOL
A truth value.
Definition: merged_model.c:95
static fr_dict_attr_t const * attr_login_ip_host
Definition: rlm_unix.c:73
static fr_dict_attr_t const * attr_crypt_password
Definition: rlm_unix.c:71
static fr_dict_attr_t const * attr_expr_bool_enum
Definition: rlm_unix.c:80
static fr_dict_attr_t const * attr_auth_type
Definition: rlm_unix.c:70
static fr_dict_attr_t const * attr_nas_ip_address
Definition: rlm_unix.c:76
static fr_dict_attr_t const * attr_framed_ip_address
Definition: rlm_unix.c:74
static fr_dict_attr_t const * attr_framed_protocol
Definition: rlm_unix.c:75
static fr_dict_attr_t const * attr_nas_port
Definition: rlm_unix.c:77
static fr_dict_attr_t const * attr_acct_status_type
Definition: rlm_unix.c:78
static fr_dict_attr_t const * attr_user_name
Definition: rlm_unix.c:72
static fr_dict_attr_t const * attr_acct_delay_time
Definition: rlm_unix.c:79

Definition at line 83 of file rlm_unix.c.

◆ trans

char trans[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static

Definition at line 48 of file rlm_unix.c.