All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions | Variables
rlm_exec.c File Reference

Execute commands and parse the results. More...

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/rad_assert.h>
+ Include dependency graph for rlm_exec.c:

Go to the source code of this file.

Data Structures

struct  rlm_exec_t


typedef struct rlm_exec_t rlm_exec_t


static rlm_rcode_t CC_HINT (nonnull)
static ssize_t exec_xlat (char **out, size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
static int mod_bootstrap (CONF_SECTION *conf, void *instance)
static size_t rlm_exec_shell_escape (UNUSED REQUEST *request, char *out, size_t outlen, char const *in, UNUSED void *inst)
static rlm_rcode_t rlm_exec_status2rcode (REQUEST *request, char *answer, size_t len, int status)
 Process the exit code returned by one of the exec functions. More...


static const CONF_PARSER module_config []
module_t rlm_exec
static char const special [] = "\\'\"`<>|; \t\r\n()[]?#$^&*="

Detailed Description

Execute commands and parse the results.


Definition in file rlm_exec.c.

Data Structure Documentation

struct rlm_exec_t

Definition at line 34 of file rlm_exec.c.

Data Fields
int bare
char const * input
pair_lists_t input_list
char const * output
pair_lists_t output_list
unsigned int packet_code
char const * packet_type
char const * program
bool shell_escape
uint32_t timeout
bool wait
char const * xlat_name

Typedef Documentation

typedef struct rlm_exec_t rlm_exec_t

Function Documentation

static rlm_rcode_t CC_HINT ( nonnull  )

Definition at line 285 of file rlm_exec.c.

+ Here is the call graph for this function:

static ssize_t exec_xlat ( char **  out,
size_t  outlen,
void const *  mod_inst,
UNUSED void const *  xlat_inst,
REQUEST request,
char const *  fmt 

Definition at line 156 of file rlm_exec.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int mod_bootstrap ( CONF_SECTION conf,
void *  instance 

Definition at line 203 of file rlm_exec.c.

+ Here is the call graph for this function:

static size_t rlm_exec_shell_escape ( UNUSED REQUEST request,
char *  out,
size_t  outlen,
char const *  in,
UNUSED void *  inst 

Definition at line 74 of file rlm_exec.c.

+ Here is the caller graph for this function:

static rlm_rcode_t rlm_exec_status2rcode ( REQUEST request,
char *  answer,
size_t  len,
int  status 

Process the exit code returned by one of the exec functions.

requestCurrent request.
answerOutput string from exec call.
lenlength of data in answer.
statuscode returned by exec call.
One of the RLM_MODULE_* values.

Definition at line 105 of file rlm_exec.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const CONF_PARSER module_config[]
Initial value:
= {
{ FR_CONF_OFFSET("wait", PW_TYPE_BOOLEAN, rlm_exec_t, wait), .dflt = "yes" },
{ FR_CONF_OFFSET("input_pairs", PW_TYPE_STRING, rlm_exec_t, input) },
{ FR_CONF_OFFSET("output_pairs", PW_TYPE_STRING, rlm_exec_t, output) },
{ FR_CONF_OFFSET("packet_type", PW_TYPE_STRING, rlm_exec_t, packet_type) },
{ FR_CONF_OFFSET("shell_escape", PW_TYPE_BOOLEAN, rlm_exec_t, shell_escape), .dflt = "yes" },
Definition: conffile.h:289
static float timeout
Definition: radclient.c:43
#define PW_TYPE_XLAT
string will be dynamically expanded.
Definition: conffile.h:207
A truth value.
Definition: radius.h:56
32 Bit unsigned integer.
Definition: radius.h:34
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition: conffile.h:168
String of printable characters.
Definition: radius.h:33

Definition at line 58 of file rlm_exec.c.

module_t rlm_exec
Initial value:
= {
.name = "exec",
.inst_size = sizeof(rlm_exec_t),
.config = module_config,
.bootstrap = mod_bootstrap,
.methods = {
[MOD_AUTHENTICATE] = mod_exec_dispatch,
[MOD_AUTHORIZE] = mod_exec_dispatch,
[MOD_PREACCT] = mod_exec_dispatch,
[MOD_PRE_PROXY] = mod_exec_dispatch,
[MOD_POST_PROXY] = mod_exec_dispatch,
[MOD_RECV_COA] = mod_exec_dispatch,
[MOD_SEND_COA] = mod_exec_dispatch
5 methods index for preproxy section.
Definition: modules.h:46
static rlm_rcode_t mod_accounting(void *instance, REQUEST *request)
Write accounting data to Couchbase documents.
static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request) CC_HINT(nonnull)
static int mod_bootstrap(CONF_SECTION *conf, void *instance)
Definition: rlm_exec.c:203
7 methods index for postauth section.
Definition: modules.h:48
Module is threadsafe.
Definition: modules.h:75
Definition: modules.h:86
static const CONF_PARSER module_config[]
Definition: rlm_exec.c:58
3 methods index for accounting section.
Definition: modules.h:44
0 methods index for authenticate section.
Definition: modules.h:41
struct rlm_exec_t rlm_exec_t
6 methods index for postproxy section.
Definition: modules.h:47
2 methods index for preacct section.
Definition: modules.h:43
8 methods index for recvcoa section.
Definition: modules.h:50
9 methods index for sendcoa section.
Definition: modules.h:51
1 methods index for authorize section.
Definition: modules.h:42

Definition at line 464 of file rlm_exec.c.

char const special[] = "\\'\"`<>|; \t\r\n()[]?#$^&*="

Definition at line 69 of file rlm_exec.c.