Authenticates against Active Directory or Samba using winbind.
More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/unlang/call_env.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <freeradius-devel/util/debug.h>
#include "rlm_winbind.h"
#include "auth_wbclient_pap.h"
#include <grp.h>
#include <wbclient.h>
Go to the source code of this file.
|
static int | _mod_conn_free (struct wbcContext **wb_ctx) |
| Free connection pool winbind context. More...
|
|
static int | domain_call_env_parse (TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, UNUSED call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule) |
|
static unlang_action_t | mod_authenticate (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
| Authenticate the user via libwbclient and winbind. More...
|
|
static unlang_action_t | mod_authorize (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
| Authorize for libwbclient/winbind authentication. More...
|
|
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
| Bootstrap this module. More...
|
|
static void * | mod_conn_create (TALLOC_CTX *ctx, UNUSED void *instance, UNUSED fr_time_delta_t timeout) |
| Create connection pool winbind context. More...
|
|
static int | mod_detach (module_detach_ctx_t const *mctx) |
| Tidy up module instance. More...
|
|
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
| Instantiate this module. More...
|
|
static bool | winbind_check_group (rlm_winbind_t const *inst, request_t *request, char const *name, winbind_group_xlat_call_env_t *env) |
| Group comparison for Winbind-Group. More...
|
|
static xlat_action_t | winbind_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 winbind group. More...
|
|
Authenticates against Active Directory or Samba using winbind.
- Id
- 95d0fc72d8239a9a221c94699b25fb9503152dc2
- Author
- Matthew Newton (matth.nosp@m.ew@n.nosp@m.ewton.nosp@m.comp.nosp@m.uting.nosp@m..co..nosp@m.uk)
- Copyright
- 2016 The FreeRADIUS server project
-
2016 Matthew Newton (matth.nosp@m.ew@n.nosp@m.ewton.nosp@m.comp.nosp@m.uting.nosp@m..co..nosp@m.uk)
Definition in file rlm_winbind.c.
◆ winbind_autz_call_env_t
struct winbind_autz_call_env_t |
◆ winbind_group_xlat_call_env_t
struct winbind_group_xlat_call_env_t |
◆ _mod_conn_free()
static int _mod_conn_free |
( |
struct wbcContext ** |
wb_ctx | ) |
|
|
static |
Free connection pool winbind context.
- Parameters
-
[in] | wb_ctx | libwbclient context |
- Returns
- 0
Definition at line 267 of file rlm_winbind.c.
◆ domain_call_env_parse()
◆ mod_authenticate()
Authenticate the user via libwbclient and winbind.
- Parameters
-
[out] | p_result | The result of the module call. |
[in] | mctx | Module instance data. |
[in] | request | The current request |
Definition at line 396 of file rlm_winbind.c.
◆ mod_authorize()
Authorize for libwbclient/winbind authentication.
Checks there is a password available so we can authenticate against winbind and, if so, sets Auth-Type to ourself.
- Parameters
-
[out] | p_result | The result of the module call:
|
[in] | mctx | Module instance data. |
[in] | request | The current request. |
Definition at line 365 of file rlm_winbind.c.
◆ mod_bootstrap()
Bootstrap this module.
- Parameters
-
[in] | mctx | data for this module |
- Returns
-
Definition at line 537 of file rlm_winbind.c.
◆ mod_conn_create()
Create connection pool winbind context.
- Parameters
-
[in] | ctx | talloc context |
[in] | instance | Module instance (unused) |
[in] | timeout | Connection timeout |
- Returns
- pointer to libwbclient context
Definition at line 283 of file rlm_winbind.c.
◆ mod_detach()
Tidy up module instance.
Frees up the libwbclient connection pool.
- Parameters
-
[in] | mctx | data for this module |
- Returns
- 0
Definition at line 344 of file rlm_winbind.c.
◆ mod_instantiate()
Instantiate this module.
- Parameters
-
[in] | mctx | data for this module |
- Returns
- 0 instantiation succeeded
- -1 instantiation failed
Definition at line 316 of file rlm_winbind.c.
◆ winbind_check_group()
Group comparison for Winbind-Group.
- Parameters
-
inst | Instance of this module |
request | The current request |
name | Group name to be searched |
env | Group check xlat call_env |
- Returns
- 0 user is in group
- 1 failure or user is not in group
Definition at line 88 of file rlm_winbind.c.
◆ attr_auth_type
◆ attr_expr_bool_enum
◆ dict_freeradius
◆ group_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition at line 40 of file rlm_winbind.c.
◆ module_config
Initial value:= {
}
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
static const conf_parser_t group_config[]
Definition at line 45 of file rlm_winbind.c.
◆ rlm_winbind
Initial value:= {
.common = {
.name = "winbind",
},
.method_group = {
}
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
static int instantiate(module_inst_ctx_t const *mctx)
static int mod_detach(module_detach_ctx_t const *mctx)
Tidy up module instance.
static const call_env_method_t winbind_autz_method_env
static const call_env_method_t winbind_auth_method_env
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Authenticate the user via libwbclient and winbind.
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Bootstrap this module.
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Authorize for libwbclient/winbind authentication.
static const conf_parser_t module_config[]
static int mod_instantiate(module_inst_ctx_t const *mctx)
Instantiate this module.
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
Definition at line 569 of file rlm_winbind.c.
◆ rlm_winbind_dict
Initial value:= {
{ NULL }
}
static fr_dict_t const * dict_freeradius
Definition at line 53 of file rlm_winbind.c.
◆ rlm_winbind_dict_attr
Initial value:= {
{ NULL }
}
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_BOOL
A truth value.
static fr_dict_attr_t const * attr_expr_bool_enum
static fr_dict_attr_t const * attr_auth_type
Definition at line 62 of file rlm_winbind.c.
◆ winbind_auth_method_env
Initial value:= {
.pair.dflt =
"&User-Password", .pair.dflt_quote =
T_BARE_WORD },
}
}
#define CALL_ENV_TERMINATOR
#define FR_CALL_ENV_METHOD_OUT(_inst)
Helper macro for populating the size/type fields of a call_env_method_t from the output structure typ...
@ CALL_ENV_FLAG_SECRET
The value is a secret, and should not be logged.
@ CALL_ENV_FLAG_REQUIRED
Associated conf pair or section is required.
#define FR_CALL_ENV_OFFSET(_name, _cast_type, _flags, _struct, _field)
Specify a call_env_parser_t which writes out runtime results to the specified field.
@ FR_TYPE_STRING
String of printable characters.
static int domain_call_env_parse(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, UNUSED call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
Definition at line 503 of file rlm_winbind.c.
◆ winbind_autz_method_env
Initial value:= {
.pair.dflt =
"&User-Password", .pair.dflt_quote =
T_BARE_WORD },
}
}
@ CALL_ENV_FLAG_ATTRIBUTE
Tmpl must contain an attribute reference.
@ CALL_ENV_FLAG_PARSE_ONLY
The result of parsing will not be evaluated at runtime.
#define FR_CALL_ENV_PARSE_ONLY_OFFSET(_name, _cast_type, _flags, _struct, _parse_field)
Specify a call_env_parser_t which writes out the result of the parsing phase to the field specified.
Definition at line 431 of file rlm_winbind.c.
◆ winbind_group_xlat_arg
Initial value:= {
}
#define XLAT_ARG_PARSER_TERMINATOR
Definition at line 302 of file rlm_winbind.c.
◆ winbind_group_xlat_call_env
Initial value:= {
}))},
}
}
#define FR_CALL_ENV_SUBSECTION(_name, _name2, _flags, _subcs)
Specify a call_env_parser_t which defines a nested subsection.
Definition at line 515 of file rlm_winbind.c.