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

Allows authentication against OpenDirectory and enforces ACLS. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/perm.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <grp.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <DirectoryService/DirectoryService.h>
#include <membership.h>
+ Include dependency graph for rlm_opendirectory.c:

Go to the source code of this file.

Data Structures

struct  rlm_opendirectory_t
 

Macros

#define kRadiusSACLName   "com.apple.access_radius"
 
#define kRadiusServiceName   "radius"
 

Functions

int mbr_check_membership_refresh (uuid_t const user, uuid_t group, int *ismember)
 
int mbr_check_service_membership (uuid_t const user, char const *servicename, int *ismember)
 
static unlang_action_t mod_authenticate (rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t mod_authorize (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static long od_check_passwd (request_t *request, char const *uname, char const *password)
 

Variables

static fr_dict_attr_t const * attr_auth_type
 
static fr_dict_attr_t const * attr_user_name
 
static fr_dict_attr_t const * attr_user_password
 
static fr_dict_t const * dict_freeradius
 
static fr_dict_t const * dict_radius
 
module_rlm_t rlm_opendirectory
 
fr_dict_autoload_t rlm_opendirectory_dict []
 
fr_dict_attr_autoload_t rlm_opendirectory_dict_attr []
 

Detailed Description

Allows authentication against OpenDirectory and enforces ACLS.

Id
55c4c26babbcb88883144c0f55ad9caf33c682fc

authentication: Apple Open Directory authentication authorization: enforces ACLs

Definition in file rlm_opendirectory.c.


Data Structure Documentation

◆ rlm_opendirectory_t

struct rlm_opendirectory_t

Definition at line 48 of file rlm_opendirectory.c.

+ Collaboration diagram for rlm_opendirectory_t:
Data Fields
fr_dict_enum_value_t * auth_type

Macro Definition Documentation

◆ kRadiusSACLName

#define kRadiusSACLName   "com.apple.access_radius"

Definition at line 60 of file rlm_opendirectory.c.

◆ kRadiusServiceName

#define kRadiusServiceName   "radius"

Definition at line 61 of file rlm_opendirectory.c.

Function Documentation

◆ mbr_check_membership_refresh()

int mbr_check_membership_refresh ( uuid_t const  user,
uuid_t  group,
int *  ismember 
)
+ Here is the caller graph for this function:

◆ mbr_check_service_membership()

int mbr_check_service_membership ( uuid_t const  user,
char const *  servicename,
int *  ismember 
)
+ Here is the caller graph for this function:

◆ mod_authenticate()

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

Definition at line 309 of file rlm_opendirectory.c.

+ Here is the call graph for this function:

◆ mod_authorize()

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

Definition at line 385 of file rlm_opendirectory.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 517 of file rlm_opendirectory.c.

+ Here is the call graph for this function:

◆ od_check_passwd()

static long od_check_passwd ( request_t request,
char const *  uname,
char const *  password 
)
static

Definition at line 91 of file rlm_opendirectory.c.

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

Variable Documentation

◆ attr_auth_type

fr_dict_attr_t const* attr_auth_type
static

Definition at line 73 of file rlm_opendirectory.c.

◆ attr_user_name

fr_dict_attr_t const* attr_user_name
static

Definition at line 74 of file rlm_opendirectory.c.

◆ attr_user_password

fr_dict_attr_t const* attr_user_password
static

Definition at line 75 of file rlm_opendirectory.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 63 of file rlm_opendirectory.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 64 of file rlm_opendirectory.c.

◆ rlm_opendirectory

module_rlm_t rlm_opendirectory
Initial value:
= {
.common = {
.name = "opendirectory",
.inst_size = sizeof(rlm_opendirectory_t),
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("authenticate", CF_IDENT_ANY), .method = mod_authenticate },
{ .section = SECTION_NAME("recv", CF_IDENT_ANY), .method = mod_authorize },
}
}
}
#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 unlang_action_t mod_authenticate(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static int mod_instantiate(module_inst_ctx_t const *mctx)
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1302
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
Definition: section.h:40
#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 532 of file rlm_opendirectory.c.

◆ rlm_opendirectory_dict

fr_dict_autoload_t rlm_opendirectory_dict
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_freeradius
static fr_dict_t const * dict_radius

Definition at line 67 of file rlm_opendirectory.c.

◆ rlm_opendirectory_dict_attr

fr_dict_attr_autoload_t rlm_opendirectory_dict_attr
Initial value:
= {
{ .out = &attr_auth_type, .name = "Auth-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
{ .out = &attr_user_name, .name = "User-Name", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ .out = &attr_user_password, .name = "User-Password", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
static fr_dict_attr_t const * attr_user_password
static fr_dict_attr_t const * attr_auth_type
static fr_dict_attr_t const * attr_user_name

Definition at line 78 of file rlm_opendirectory.c.