Execute commands and parse the results.
More...
#include <stdint.h>
#include <freeradius-devel/server/log.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/server/exec.h>
#include <freeradius-devel/server/main_config.h>
#include <freeradius-devel/unlang/interpret.h>
#include <freeradius-devel/unlang/call_env.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/token.h>
#include <freeradius-devel/server/pairmove.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <freeradius-devel/unlang/xlat.h>
#include <freeradius-devel/unlang/module.h>
Go to the source code of this file.
|
static xlat_action_t | exec_xlat_oneshot (TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Exec programs from an xlat. More...
|
|
static xlat_action_t | exec_xlat_oneshot_wait_resume (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
|
static int | mob_instantiate (module_inst_ctx_t const *mctx) |
|
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
|
static unlang_action_t | mod_exec_dispatch_oneshot (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
| Dispatch one request using a short lived process. More...
|
|
static unlang_action_t | mod_exec_oneshot_nowait_resume (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
| Resume a request after xlat expansion. More...
|
|
static unlang_action_t | mod_exec_oneshot_wait_resume (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
| Process the exit code and output of a short lived process. More...
|
|
static rlm_rcode_t | rlm_exec_status2rcode (request_t *request, fr_value_box_t *box, int status) |
| Process the exit code returned by one of the exec functions. More...
|
|
Execute commands and parse the results.
- Id
- 3c1ac23a4d58ee9062aece1f3ee762b0f1fd16f4
- Copyright
- 2002,2006 The FreeRADIUS server project
-
2002 Alan DeKok (aland.nosp@m.@fre.nosp@m.eradi.nosp@m.us.o.nosp@m.rg)
Definition in file rlm_exec.c.
◆ exec_call_env_t
◆ rlm_exec_ctx_t
Definition at line 176 of file rlm_exec.c.
Data Fields |
fr_value_box_list_t |
box |
|
int |
status |
|
◆ rlm_exec_t
◆ LOG_PREFIX
◆ exec_xlat_oneshot_wait_resume()
◆ mob_instantiate()
◆ mod_bootstrap()
◆ mod_exec_dispatch_oneshot()
Dispatch one request using a short lived process.
Definition at line 385 of file rlm_exec.c.
◆ mod_exec_oneshot_nowait_resume()
Resume a request after xlat expansion.
Definition at line 240 of file rlm_exec.c.
◆ mod_exec_oneshot_wait_resume()
Process the exit code and output of a short lived process.
Definition at line 282 of file rlm_exec.c.
◆ rlm_exec_status2rcode()
Process the exit code returned by one of the exec functions.
- Parameters
-
request | Current request. |
box | Output string from exec call. |
status | code returned by exec call. |
- Returns
- One of the RLM_MODULE_* values.
Definition at line 202 of file rlm_exec.c.
◆ exec_method_env
Initial value:= {
}
}
#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_FORCE_QUOTE
Force quote method when parsing tmpl.
#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.
@ FR_TYPE_STRING
String of printable characters.
Definition at line 72 of file rlm_exec.c.
◆ exec_xlat_args
Initial value:= {
}
@ XLAT_ARG_VARIADIC_EMPTY_KEEP
Empty argument groups are left alone, and either passed through as empty groups or null boxes.
#define XLAT_ARG_PARSER_TERMINATOR
Definition at line 119 of file rlm_exec.c.
◆ module_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
#define FR_CONF_OFFSET_IS_SET(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct,...
static fr_time_delta_t timeout
@ FR_TYPE_TIME_DELTA
A period of time measured in nanoseconds.
Definition at line 58 of file rlm_exec.c.
◆ rhs_term
fr_sbuff_parse_rules_t const rhs_term |
|
static |
Initial value:= {
.chr = '\\',
.do_hex = true,
.do_oct = false
},
)
}
#define L(_str)
Helper for initialising arrays of string literals.
#define FR_SBUFF_TERMS(...)
Initialise a terminal structure with a list of sorted strings.
Set of parsing rules for *unescape_until functions.
Definition at line 265 of file rlm_exec.c.
◆ rlm_exec
Initial value:= {
.common = {
.name = "exec",
},
.method_group = {
}
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
static int mod_bootstrap(module_inst_ctx_t const *mctx)
static unlang_action_t mod_exec_dispatch_oneshot(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Dispatch one request using a short lived process.
static const call_env_method_t exec_method_env
static int mob_instantiate(module_inst_ctx_t const *mctx)
static const conf_parser_t module_config[]
static int instantiate(module_inst_ctx_t const *mctx)
#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 525 of file rlm_exec.c.
◆ status2rcode
Initial value:= {
}
@ RLM_MODULE_INVALID
The module considers the request invalid.
@ RLM_MODULE_OK
The module is OK, continue.
@ RLM_MODULE_FAIL
Module failed, don't reply.
@ RLM_MODULE_DISALLOW
Reject the request (user is locked out).
@ RLM_MODULE_REJECT
Immediately reject the request.
@ RLM_MODULE_NOTFOUND
User not found.
@ RLM_MODULE_UPDATED
OK (pairs modified).
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
@ RLM_MODULE_HANDLED
The module handled the request, so stop.
Definition at line 181 of file rlm_exec.c.