The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
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/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.

Macros

#define LOG_PREFIX   mctx->mi->name
 

Functions

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 (request_t *request, char const *name)
 Check if the user is in the given group.
 
static xlat_action_t unix_group_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED 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.
 

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
 
module_rlm_t rlm_unix
 
fr_dict_autoload_t rlm_unix_dict []
 
fr_dict_attr_autoload_t rlm_unix_dict_attr []
 

Detailed Description

Unixy things.

Id
d1cc1b6c0b534884d13c5976fef7ddd0d7fe27f3

Definition in file rlm_unix.c.

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   mctx->mi->name

Definition at line 29 of file rlm_unix.c.

Function Documentation

◆ 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 207 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 169 of file rlm_unix.c.

+ Here is the call graph for this function:

◆ unix_check_group()

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

Check if the user is in the given group.

Definition at line 88 of file rlm_unix.c.

+ Here is the call graph for this function:
+ 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 66 of file rlm_unix.c.

◆ attr_acct_status_type

fr_dict_attr_t const* attr_acct_status_type
static

Definition at line 65 of file rlm_unix.c.

◆ attr_auth_type

fr_dict_attr_t const* attr_auth_type
static

Definition at line 57 of file rlm_unix.c.

◆ attr_crypt_password

fr_dict_attr_t const* attr_crypt_password
static

Definition at line 58 of file rlm_unix.c.

◆ attr_expr_bool_enum

fr_dict_attr_t const* attr_expr_bool_enum
static

Definition at line 67 of file rlm_unix.c.

◆ attr_framed_ip_address

fr_dict_attr_t const* attr_framed_ip_address
static

Definition at line 61 of file rlm_unix.c.

◆ attr_framed_protocol

fr_dict_attr_t const* attr_framed_protocol
static

Definition at line 62 of file rlm_unix.c.

◆ attr_login_ip_host

fr_dict_attr_t const* attr_login_ip_host
static

Definition at line 60 of file rlm_unix.c.

◆ attr_nas_ip_address

fr_dict_attr_t const* attr_nas_ip_address
static

Definition at line 63 of file rlm_unix.c.

◆ attr_nas_port

fr_dict_attr_t const* attr_nas_port
static

Definition at line 64 of file rlm_unix.c.

◆ attr_user_name

fr_dict_attr_t const* attr_user_name
static

Definition at line 59 of file rlm_unix.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 47 of file rlm_unix.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 48 of file rlm_unix.c.

◆ rlm_unix

module_rlm_t rlm_unix
Initial value:
= {
.common = {
.name = "unix",
.bootstrap = mod_bootstrap
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("recv", "Access-Request"), .method = mod_authorize },
}
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition dl_module.h:63
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Definition rlm_unix.c:169
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
Definition rlm_unix.c:207
#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 329 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:47
static fr_dict_t const * dict_radius
Definition rlm_unix.c:48

Definition at line 51 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.
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_BOOL
A truth value.
static fr_dict_attr_t const * attr_login_ip_host
Definition rlm_unix.c:60
static fr_dict_attr_t const * attr_crypt_password
Definition rlm_unix.c:58
static fr_dict_attr_t const * attr_expr_bool_enum
Definition rlm_unix.c:67
static fr_dict_attr_t const * attr_auth_type
Definition rlm_unix.c:57
static fr_dict_attr_t const * attr_nas_ip_address
Definition rlm_unix.c:63
static fr_dict_attr_t const * attr_framed_ip_address
Definition rlm_unix.c:61
static fr_dict_attr_t const * attr_framed_protocol
Definition rlm_unix.c:62
static fr_dict_attr_t const * attr_nas_port
Definition rlm_unix.c:64
static fr_dict_attr_t const * attr_acct_status_type
Definition rlm_unix.c:65
static fr_dict_attr_t const * attr_user_name
Definition rlm_unix.c:59
static fr_dict_attr_t const * attr_acct_delay_time
Definition rlm_unix.c:66

Definition at line 70 of file rlm_unix.c.