27 RCSID(
"$Id: 4748ef6ccf12f9b13ea80124dabefe524a86aa19 $")
31 #include <freeradius-devel/radiusd.h>
32 #include <freeradius-devel/modules.h>
33 #include <freeradius-devel/map_proc.h>
34 #include <freeradius-devel/token.h>
35 #include <freeradius-devel/rad_assert.h>
36 #include <freeradius-devel/exfile.h>
103 #ifdef WITH_SESSION_MGMT
144 void const *mod_inst,
UNUSED void const *xlat_inst,
145 REQUEST *request,
char const *fmt)
161 if (!handle)
return 0;
184 if (numaffected < 1) {
185 RDEBUG(
"SQL query affected no rows");
190 MEM(*out = talloc_asprintf(request,
"%d", numaffected));
191 ret = talloc_array_length(*out) - 1;
208 RDEBUG(
"SQL query returned no results");
216 RDEBUG(
"NULL value in first column of result");
224 ret = talloc_array_length(*out) - 1;
248 char const *value = uctx;
258 escaped =
fr_asprint(vp, value, talloc_array_length(value),
'"');
259 REDEBUG(
"Failed parsing value \"%s\" for attribute %s: %s", escaped,
285 char const *query,
vp_map_t const *maps)
301 char const **fields = NULL, *map_rhs;
302 char map_rhs_buff[128];
304 #define MAX_SQL_FIELD_INDEX (64)
307 bool found_field =
false;
321 if (!handle)
return 0;
341 field_cnt = talloc_array_length(fields);
350 for (map = maps, i = 0;
352 map = map->
next, i++) {
356 if (
tmpl_expand(&map_rhs, map_rhs_buff,
sizeof(map_rhs_buff),
357 request, map->rhs, NULL, NULL) < 0) {
362 for (j = 0; j < field_cnt; j++) {
363 if (strcmp(fields[j], map_rhs) != 0)
continue;
374 RDEBUG(
"No fields matching map found in query result");
390 for (map = maps, j = 0;
392 map = map->
next, j++) {
393 if (field_index[j] < 0)
continue;
401 RDEBUG(
"SQL query returned no results");
422 DEBUG(
"rlm_sql (%s): Processing generate_sql_clients",
425 DEBUG(
"rlm_sql (%s) in generate_sql_clients: query is %s",
429 if (!handle)
return -1;
448 ERROR(
"rlm_sql (%s): No row id found on pass %d",inst->
name,i);
452 ERROR(
"rlm_sql (%s): No nasname found for row %s",inst->
name,row[0]);
456 ERROR(
"rlm_sql (%s): No short name found for row %s",inst->
name,row[0]);
460 ERROR(
"rlm_sql (%s): No secret found for row %s",inst->
name,row[0]);
468 DEBUG(
"rlm_sql (%s): Adding client %s (%s) to %s clients list",
470 row[1], row[2], server ? server :
"global");
485 WARN(
"Failed to add client, possible duplicate?");
519 if (outlen <= utf8_len)
break;
521 memcpy(out, in, utf8_len);
537 if (outlen <= 2)
break;
548 if (outlen <= 2)
break;
559 if (outlen <= 2)
break;
583 snprintf(out, outlen,
"=%02X", (
unsigned char) in[0]);
643 char *expanded = NULL;
650 if (username != NULL) {
658 len =
radius_axlat(&expanded, request, sqluser, NULL, NULL);
665 talloc_free(expanded);
670 RDEBUG2(
"SQL-User-Name set to '%s'", vp->vp_strvalue);
680 #define sql_unset_user(_i, _r) fr_pair_delete_by_num(&_r->packet->vps, _i->sql_user->vendor, _i->sql_user->attr, TAG_ANY)
685 char *expanded = NULL;
693 entry = *phead = NULL;
699 talloc_free(expanded);
703 row = (*handle)->row;
708 RDEBUG(
"row[0] returned NULL");
755 RWARN(
"Cannot do group comparison when group_membership_query is not set");
761 if (check->vp_length == 0){
762 RDEBUG(
"sql_groupcmp: Illegal group name");
784 REDEBUG(
"Error getting group membership");
789 for (entry = head; entry != NULL; entry = entry->
next) {
790 if (strcmp(entry->
name, check->vp_strvalue) == 0){
791 RDEBUG(
"sql_groupcmp finished: User is a member of group %s",
803 RDEBUG(
"sql_groupcmp finished: User is NOT a member of group %s", check->vp_strvalue);
812 VALUE_PAIR *check_tmp = NULL, *reply_tmp = NULL, *sql_group = NULL;
815 char *expanded = NULL;
821 RWARN(
"Cannot do check groups when group_membership_query is not set");
838 REDEBUG(
"Error retrieving group list");
843 RDEBUG2(
"User not found in any groups");
848 RDEBUG2(
"User found in the group table");
876 REDEBUG(
"Error generating query");
881 rows =
sql_getvpdata(request, inst, request, handle, &check_tmp, expanded);
882 TALLOC_FREE(expanded);
884 REDEBUG(
"Error retrieving check pairs for group %s", entry->name);
903 RDEBUG2(
"Group \"%s\": Conditional check items matched", entry->name);
906 RDEBUG2(
"Group \"%s\": Merging assignment check items", entry->name);
926 REDEBUG(
"Error generating query");
932 TALLOC_FREE(expanded);
934 REDEBUG(
"Error retrieving reply pairs for group %s", entry->name);
940 RDEBUG2(
"Group \"%s\": Merging reply items", entry->name);
981 talloc_free_children(inst);
1013 ERROR(
"Make sure it (and all its dependent libraries!) are in the search path of your system's ld");
1023 INFO(
"rlm_sql (%s): Driver %s (module %s) loaded and linked", inst->
name,
1029 char const *group_attribute;
1034 snprintf(buffer,
sizeof(buffer),
"%s-SQL-Group", inst->
name);
1035 group_attribute = buffer;
1037 group_attribute =
"SQL-Group";
1051 ERROR(
"Failed resolving group attribute \"%s\"", group_attribute);
1091 WARN(
"rlm_sql (%s): Ignoring authorize_group_reply_query as group_membership_query "
1092 "is not configured", inst->
name);
1096 WARN(
"rlm_sql (%s): Ignoring authorize_group_check_query as group_membership_query "
1097 "is not configured", inst->
name);
1101 WARN(
"rlm_sql (%s): Ignoring read_groups as group_membership_query "
1102 "is not configured", inst->
name);
1181 INFO(
"rlm_sql (%s): Attempting to connect to database \"%s\"", inst->
name, inst->
config->
sql_db);
1184 if (!inst->
pool)
return -1;
1188 ERROR(
"Failed to load clients from SQL");
1208 bool user_found =
false;
1214 char *expanded = NULL;
1221 RWDEBUG(
"No authorization checks configured, returning noop");
1254 REDEBUG(
"Error generating query");
1259 rows =
sql_getvpdata(request, inst, request, &handle, &check_tmp, expanded);
1260 TALLOC_FREE(expanded);
1262 REDEBUG(
"Error getting check attributes");
1267 if (rows == 0)
goto skipreply;
1272 RDEBUG2(
"User found in radcheck table");
1280 RDEBUG2(
"Conditional check items matched, merging assignment check items");
1302 REDEBUG(
"Error generating query");
1308 TALLOC_FREE(expanded);
1310 REDEBUG(
"SQL query error getting reply attributes");
1315 if (rows == 0)
goto skipreply;
1319 RDEBUG2(
"User found in radreply table, merging reply items");
1341 RDEBUG3(
"... falling-through to group processing");
1378 RDEBUG3(
"... falling-through to profile processing");
1381 char const *profile = user_profile ?
1382 user_profile->vp_strvalue :
1385 if (!profile || !*profile) {
1389 RDEBUG2(
"Checking profile %s", profile);
1392 REDEBUG(
"Error setting profile");
1463 int numaffected = 0;
1467 char const *attr = NULL;
1472 char *expanded = NULL;
1492 RWDEBUG(
"No such configuration item %s", path);
1498 RWDEBUG(
"Sections are not supported as references");
1507 RDEBUG2(
"Using query template '%s'", attr);
1521 RDEBUG(
"Ignoring null query");
1534 RDEBUG(
"Ignoring null query");
1536 talloc_free(expanded);
1544 TALLOC_FREE(expanded);
1590 RDEBUG(
"%i record(s) updated", numaffected);
1592 if (numaffected > 0)
break;
1601 RDEBUG(
"No additional queries configured");
1607 RDEBUG(
"Trying next query...");
1612 talloc_free(expanded);
1619 #ifdef WITH_ACCOUNTING
1638 #ifdef WITH_SESSION_MGMT
1656 char const *call_num = NULL;
1659 uint32_t nas_addr = 0;
1662 char *expanded = NULL;
1668 REDEBUG(
"Zero Length username not permitted");
1708 TALLOC_FREE(expanded);
1739 ipno = vp->vp_ipaddr;
1743 call_num = vp->vp_strvalue;
1753 RDEBUG(
"Cannot zap stale entry. No username present in entry");
1760 RDEBUG(
"Cannot zap stale entry. No session id in entry");
1767 nas_addr = inet_addr(row[3]);
1771 nas_port = atoi(row[4]);
1774 check =
rad_check_ts(nas_addr, nas_port, row[2], row[1]);
1780 uint32_t framed_addr = 0;
1785 framed_addr = inet_addr(row[5]);
1787 if (strcmp(row[7],
"PPP") == 0)
1789 else if (strcmp(row[7],
"SLIP") == 0)
1793 sess_time = atoi(row[8]);
1795 row[2], row[1], framed_addr,
1799 else if (check == 1) {
1808 if (row[5] && ipno && inet_addr(row[5]) == ipno) {
1810 }
else if (row[6] && call_num && !strncmp(row[6],call_num,16)) {
1818 REDEBUG(
"Failed to check the terminal server for user '%s'.", row[2]);
1829 talloc_free(expanded);
1868 .config = module_config,
1874 #ifdef WITH_ACCOUNTING
1877 #ifdef WITH_SESSION_MGMT
void fr_pair_list_free(VALUE_PAIR **)
Free memory used by a valuepair list.
ssize_t ssize_t ssize_t radius_axlat(char **out, REQUEST *request, char const *fmt, xlat_escape_t escape, void *escape_ctx) CC_HINT(nonnull(1
static size_t sql_escape_func(REQUEST *, char *out, size_t outlen, char const *in, void *arg)
rlm_sql_t * inst
The rlm_sql instance this connection belongs to.
ssize_t tmpl_expand(char const **out, char *buff, size_t outlen, REQUEST *request, vp_tmpl_t const *vpt, xlat_escape_t escape, void *escape_ctx)
Expand a vp_tmpl_t to a string writing the result to a buffer.
void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from, bool do_xlat) CC_HINT(nonnull)
const FR_NAME_NUMBER sql_rcode_table[]
2nd highest priority debug messages (-xx | -X).
General connection/server error.
char const * client_query
Query used to get FreeRADIUS client definitions.
VALUE_PAIR * config
VALUE_PAIR (s) used to set per request parameters for modules and the server core at runtime...
#define RINDENT()
Indent R* messages by one level.
sql_rcode_t(* sql_fields)(char const **out[], rlm_sql_handle_t *handle, rlm_sql_config_t *config)
int int map_to_request(REQUEST *request, vp_map_t const *map, radius_map_getvalue_t func, void *ctx)
Convert vp_map_t to VALUE_PAIR (s) and add them to a REQUEST.
fr_dict_attr_t const * group_da
Group dictionary attribute.
void sql_rcode_t sql_rcode_t rlm_sql_query(rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, char const *query) CC_HINT(nonnull(1
int xlat_register(void *mod_inst, char const *name, xlat_func_t func, xlat_escape_t escape, xlat_instantiate_t instantiate, size_t inst_size, size_t buf_len)
Register an xlat function.
char const * authorize_group_check_query
Query used get check VPs for a group.
#define RDEBUG_ENABLED3
True if request debug level 1-3 messages are enabled.
int session_zap(REQUEST *request, uint32_t nasaddr, uint32_t nas_port, char const *user, char const *sessionid, uint32_t cliaddr, char proto, int session_time)
sql_acct_section_t postauth
sql_rcode_t(* sql_finish_select_query)(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
void rdebug_pair(log_lvl_t level, REQUEST *, VALUE_PAIR *, char const *)
Print a single valuepair to stderr or error log.
Prototypes and functions for the SQL module.
The module is OK, continue.
void sql_rcode_t sql_rcode_t int rlm_sql_fetch_row(rlm_sql_row_t *out, rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle)
Call the driver's sql_fetch_row function.
Metadata exported by the module.
char const * simul_count_query
Query used get number of active sessions for a user (basic simultaneous use check).
char const * authorize_reply_query
Query used get reply VPs for a user.
char const * name
Raw string used to create the template.
lt_dlhandle lt_dlopenext(char const *name)
vp_tmpl_t * lhs
Typically describes the attribute to add, modify or compare.
7 methods index for postauth section.
void sql_rcode_t rlm_sql_select_query(rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, char const *query) CC_HINT(nonnull(1
static int _sql_map_proc_get_value(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t const *map, void *uctx)
Converts a string value into a VALUE_PAIR.
int paircompare(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check, VALUE_PAIR **rep_list)
Compare two pair lists except for the password information.
char const * logfile
Keep a log of all SQL queries executed Useful for batch insertion with the NULL drivers.
static int sql_get_grouplist(rlm_sql_t *inst, rlm_sql_handle_t **handle, REQUEST *request, rlm_sql_grouplist_t **phead)
#define RLM_TYPE_THREAD_SAFE
Module is threadsafe.
static sql_fall_through_t fall_through(VALUE_PAIR *vp)
bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client)
Add a client to a RADCLIENT_LIST.
VALUE_PAIR * username
Cached username VALUE_PAIR from request RADIUS_PACKET.
static size_t sql_escape_for_xlat_func(REQUEST *request, char *out, size_t outlen, char const *in, void *arg)
Passed as the escape function to map_proc and sql xlat methods.
CONF_SECTION * cs
The CONF_SECTION representing the group of queries to process.
sql_acct_section_t accounting
char const * reference
Reference string, expanded to point to a group of queries.
VALUE_PAIR * vps
Result of decoding the packet into VALUE_PAIRs.
#define CONF_PARSER_TERMINATOR
int sql_set_user(rlm_sql_t const *inst, REQUEST *request, char const *username)
#define pair_make_request(_a, _b, _c)
VALUE_PAIR * fr_cursor_init(vp_cursor_t *cursor, VALUE_PAIR *const *node)
Setup a cursor to iterate over attribute pairs.
fr_dict_attr_t const * sql_user
Cached pointer to SQL-User-Name.
PUBLIC int snprintf(char *string, size_t length, char *format, va_alist)
int simul_max
Maximum number of concurrent sessions for this user.
int map_proc_register(void *mod_inst, char const *name, map_proc_func_t evaluate, xlat_escape_t escape, map_proc_instantiate_t instantiate, size_t inst_size)
Register a map processor.
#define PW_TYPE_SECRET
Only print value if debug level >= 3.
The module considers the request invalid.
static const CONF_PARSER type_config[]
bool do_clients
Read clients from SQL database.
#define PW_TYPE_SUBSECTION
Defines a CONF_PAIR to C data type mapping.
char const * simul_verify_query
Query to get active sessions for a user the result is fed to session_zap.
Abstraction to allow iterating over different configurations of VALUE_PAIRs.
CONF_PAIR * cf_pair_find(CONF_SECTION const *, char const *name)
char const * cf_pair_value(CONF_PAIR const *pair)
struct vp_map * next
The next valuepair map.
Key constraint violation.
static char const * proto
sql_rcode_t(* sql_fetch_row)(rlm_sql_row_t *out, rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle)
struct sql_grouplist * next
void fr_pair_value_strsteal(VALUE_PAIR *vp, char const *src)
Reparent an allocated char buffer to a VALUE_PAIR.
Stale connection, should reconnect.
#define sql_unset_user(_i, _r)
static rlm_rcode_t mod_authorize(void *instance, REQUEST *request) CC_HINT(nonnull)
static int mod_detach(void *instance)
static int mod_instantiate(CONF_SECTION *conf, void *instance)
fr_connection_pool_t * module_connection_pool_init(CONF_SECTION *module, void *opaque, fr_connection_create_t c, fr_connection_alive_t a, char const *prefix)
Initialise a module specific connection pool.
int(* sql_set_user)(rlm_sql_t const *inst, REQUEST *request, char const *username)
char const * query_user
xlat expansion used to specify the user to use as the subject of queries.
static int generate_sql_clients(rlm_sql_t *inst)
char const * cf_pair_attr(CONF_PAIR const *pair)
int simul_count
The current number of sessions for this user.
void fr_pair_value_strcpy(VALUE_PAIR *vp, char const *src)
Copy data into an "string" data type.
bool cf_item_is_section(CONF_ITEM const *item)
bool read_groups
Read user groups by default.
static void * mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval const *timeout)
Create a new memcached handle.
sql_rcode_t(* sql_select_query)(rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, char const *query)
void rlm_sql_query_log(rlm_sql_t const *inst, REQUEST *request, sql_acct_section_t *section, char const *query) CC_HINT(nonnull(1
const bool fr_assignment_op[]
#define PW_TYPE_XLAT
string will be dynamically expanded.
CONF_PAIR * cf_item_to_pair(CONF_ITEM const *item)
Cast a CONF_ITEM to a CONF_PAIR.
4 methods index for checksimul section.
unsigned int attr
Attribute number.
struct sql_inst rlm_sql_t
#define MAX_SQL_FIELD_INDEX
xlat_escape_t sql_escape_func
3 methods index for accounting section.
Stores an attribute, a value and various bits of other data.
RADIUS_PACKET * reply
Outgoing response.
static ssize_t sql_xlat(char **out, UNUSED size_t outlen, void const *mod_inst, UNUSED void const *xlat_inst, REQUEST *request, char const *fmt)
Execute an arbitrary SQL query.
void void cf_log_err_cs(CONF_SECTION const *cs, char const *fmt,...) CC_HINT(format(printf
int rad_check_ts(uint32_t nasaddr, uint32_t nas_port, char const *user, char const *sessionid)
xlat_escape_t sql_escape_func
CONF_PAIR * cf_pair_find_next(CONF_SECTION const *, CONF_PAIR const *, char const *name)
Find a pair with a name matching attr, after specified pair.
#define REXDENT()
Exdent (unindent) R* messages by one level.
static int sql_groupcmp(void *instance, REQUEST *request, UNUSED VALUE_PAIR *request_vp, VALUE_PAIR *check, UNUSED VALUE_PAIR *check_pairs, UNUSED VALUE_PAIR **reply_pairs) CC_HINT(nonnull(1
Configuration AVP similar to a VALUE_PAIR.
rlm_sql_config_t * config
FR_TOKEN op
Operator to use when moving or inserting valuepair into a list.
enum rlm_rcodes rlm_rcode_t
Return codes indicating the result of the module call.
ssize_t radius_xlat(char *out, size_t outlen, REQUEST *request, char const *fmt, xlat_escape_t escape, void *escape_ctx) CC_HINT(nonnull(1
int fr_pair_value_from_str(VALUE_PAIR *vp, char const *value, size_t len)
Convert string value to native attribute value.
static const CONF_PARSER module_config[]
char const * fr_strerror(void)
Get the last library error.
#define PW_TYPE_MULTI
CONF_PAIR can have multiple copies.
CONF_SECTION * cf_section_sub_find(CONF_SECTION const *, char const *name)
Find a sub-section in a section.
void rdebug_pair_list(log_lvl_t level, REQUEST *, VALUE_PAIR *, char const *)
Print a list of VALUE_PAIRs.
void fr_pair_delete_by_num(VALUE_PAIR **head, unsigned int vendor, unsigned int attr, int8_t tag)
Delete matching pairs.
char const * group_attribute
Name of the group attribute.
static const CONF_PARSER query_config[]
char const * cf_section_name1(CONF_SECTION const *cs)
rlm_sql_row_t row
Row data from the last query.
#define PW_TYPE_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Module succeeded without doing anything.
int sql_getvpdata(TALLOC_CTX *ctx, rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, VALUE_PAIR **pair, char const *query)
Describes a host allowed to send packets to the server.
char name[1]
Attribute name.
rlm_sql_config_t myconfig
char * talloc_bstrndup(void const *t, char const *in, size_t inlen)
Binary safe strndup function.
uint64_t magic
Used to validate module struct.
Module failed, don't reply.
static rlm_rcode_t mod_checksimul(void *instance, REQUEST *request) CC_HINT(nonnull)
FR_TOKEN op
The operator that controls insertion of the dst attribute.
char const * allowed_chars
Chars which done need escaping..
static int mod_bootstrap(CONF_SECTION *conf, void *instance)
#define FR_CONF_OFFSET(_n, _t, _s, _f)
char const * default_profile
Default profile to use if no other profiles were configured.
VALUE_PAIR * fr_cursor_next(vp_cursor_t *cursor)
Advanced the cursor to the next VALUE_PAIR.
int paircompare_register_byname(char const *name, fr_dict_attr_t const *from, bool first_only, RAD_COMPARE_FUNC func, void *instance)
Register a function as compare function.
char * fr_asprint(TALLOC_CTX *ctx, char const *in, ssize_t inlen, char quote)
Escape string that may contain binary data, and write it to a new buffer.
int strncasecmp(char *s1, char *s2, int n)
void * fr_connection_get(fr_connection_pool_t *pool)
Reserve a connection in the connection pool.
static rlm_rcode_t rlm_sql_process_groups(rlm_sql_t *inst, REQUEST *request, rlm_sql_handle_t **handle, sql_fall_through_t *do_fall_through)
RADIUS_PACKET * packet
Incoming request.
CONF_SECTION * cf_section_alloc(CONF_SECTION *parent, char const *name1, char const *name2)
Allocate a CONF_SECTION.
bool delete_stale_sessions
Whether we should use session_zap to create a fake stop packet, to terminate any stale sessions...
static rlm_rcode_t mod_accounting(void *instance, REQUEST *request) CC_HINT(nonnull)
bool read_profiles
Read user profiles by default.
char const * sql_db
Database to run queries against.
VALUE_PAIR * fr_pair_find_by_num(VALUE_PAIR *head, unsigned int vendor, unsigned int attr, int8_t tag)
Find the pair with the matching attribute.
char const * name
Module instance name.
char const * longname
Client identifier.
sql_rcode_t(* sql_query)(rlm_sql_t const *inst, REQUEST *request, rlm_sql_handle_t **handle, char const *query)
VALUE_PAIR * fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
Dynamically allocate a new attribute.
char const * fr_int2str(FR_NAME_NUMBER const *table, int number, char const *def)
char const * sql_driver_name
SQL driver module name e.g. rlm_sql_sqlite.
sql_rcode_t(* sql_finish_query)(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
exfile_t * exfile_init(TALLOC_CTX *ctx, uint32_t entries, uint32_t idle, bool locking)
Initialize a way for multiple threads to log to one or more files.
int fr_utf8_char(uint8_t const *str, ssize_t inlen)
Checks for utf-8, taken from http://www.w3.org/International/questions/qa-forms-utf-8.
void fr_connection_release(fr_connection_pool_t *pool, void *conn)
Release a connection.
fr_dict_attr_t const * fr_dict_attr_by_num(fr_dict_t *dict, unsigned int vendor, unsigned int attr)
Lookup a fr_dict_attr_t by its vendor and attribute numbers.
String of printable characters.
#define FR_CONF_POINTER(_n, _t, _p)
1 methods index for authorize section.
RADCLIENT * client_afrom_query(TALLOC_CTX *ctx, char const *identifier, char const *secret, char const *shortname, char const *type, char const *server, bool require_ma) CC_HINT(nonnull(2
rlm_sql_module_t * module
char * talloc_typed_strdup(void const *t, char const *p)
Call talloc strdup, setting the type on the new chunk correctly.
static const CONF_PARSER postauth_config[]
fr_connection_pool_t * pool
sql_rcode_t(* mod_instantiate)(CONF_SECTION *conf, rlm_sql_config_t *config)
int(* sql_num_fields)(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
int(* sql_affected_rows)(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
static const CONF_PARSER acct_config[]
int simul_mpp
WEIRD: 1 is false, 2 is true.
char const * authorize_check_query
Query used get check VPs for a user.
char const * cf_section_name2(CONF_SECTION const *cs)
char const * shortname
Client nickname.
void fr_connection_pool_free(fr_connection_pool_t *pool)
Delete a connection pool.
static int acct_redundant(rlm_sql_t *inst, REQUEST *request, sql_acct_section_t *section)
static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request) CC_HINT(nonnull)
char const * groupmemb_query
Query to determine group membership.
char const * authorize_group_reply_query
Query used get reply VPs for a group.
fr_dict_attr_t const * fr_dict_attr_by_name(fr_dict_t *dict, char const *attr)
Locate a fr_dict_attr_t by its name.
static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, REQUEST *request, char const *query, vp_map_t const *maps)
Executes a SELECT query and maps the result to server attributes.
void client_free(RADCLIENT *client)
CONF_ITEM * cf_reference_item(CONF_SECTION const *parentcs, CONF_SECTION *outercs, char const *ptr)