# attribute = 'radiusProfileDn'
}
- #
- # Bulk load clients from the directory
- #
- client {
- # Where to start searching in the tree for clients
- base_dn = "${..base_dn}"
-
- #
- # Filter to match client objects
- #
- filter = '(objectClass=radiusClient)'
-
- # Search scope, may be 'base', 'one', 'sub' or 'children'
-# scope = 'sub'
-
- #
- # Sets default values (not obtained from LDAP) for new client entries
- #
- template {
-# login = 'test'
-# password = 'test'
-# proto = tcp
-# require_message_authenticator = yes
- }
-
- #
- # Client attribute mappings are in the format:
- # <client attribute> = <ldap attribute>
- #
- # The following attributes are required:
- # * ipaddr | ipv4addr | ipv6addr - Client IP Address.
- # * secret - RADIUS shared secret.
- #
- # All other attributes usually supported in a client
- # definition are also supported here.
- #
- # Schemas are available in doc/schemas/ldap for openldap and eDirectory
- #
- attribute {
- ipaddr = 'radiusClientIdentifier'
- secret = 'radiusClientSecret'
-# shortname = 'radiusClientShortname'
-# nas_type = 'radiusClientType'
-# virtual_server = 'radiusClientVirtualServer'
-# require_message_authenticator = 'radiusClientRequireMa'
- }
- }
-
- # Load clients on startup
-# read_clients = no
-
#
# Modify user object on receiving Accounting-Request
#
CONF_PARSER_TERMINATOR
};
-static CONF_PARSER client_config[] = {
- { FR_CONF_OFFSET("filter", FR_TYPE_STRING, rlm_ldap_t, clientobj_filter) },
- { FR_CONF_OFFSET("scope", FR_TYPE_STRING, rlm_ldap_t, clientobj_scope_str), .dflt = "sub" },
- { FR_CONF_OFFSET("base_dn", FR_TYPE_STRING, rlm_ldap_t, clientobj_base_dn), .dflt = "" },
- CONF_PARSER_TERMINATOR
-};
-
/*
* Reference for accounting updates
*/
{ FR_CONF_OFFSET("edir_autz", FR_TYPE_BOOL, rlm_ldap_t, edir_autz) }, /* NULL defaults to "no" */
#endif
- { FR_CONF_OFFSET("read_clients", FR_TYPE_BOOL, rlm_ldap_t, do_clients) }, /* NULL defaults to "no" */
-
{ FR_CONF_POINTER("user", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) user_config },
{ FR_CONF_POINTER("group", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) group_config },
- { FR_CONF_POINTER("client", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) client_config },
-
{ FR_CONF_POINTER("profile", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) profile_config },
{ FR_CONF_POINTER("options", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) option_config },
goto error;
}
- inst->clientobj_scope = fr_str2int(fr_ldap_scope, inst->clientobj_scope_str, -1);
- if (inst->clientobj_scope < 0) {
-#ifdef LDAP_SCOPE_CHILDREN
- cf_log_err(conf, "Invalid 'client.scope' value \"%s\", expected 'sub', 'one', 'base' or 'children'",
- inst->clientobj_scope_str);
-#else
- cf_log_err(conf, "Invalid 'client.scope' value \"%s\", expected 'sub', 'one' or 'children'",
- inst->clientobj_scope_str);
-#endif
- goto error;
- }
-
#ifdef HAVE_LDAP_CREATE_SORT_CONTROL
/*
* Build the server side sort control for user objects
mod_conn_create, NULL, NULL, NULL, NULL);
if (!inst->pool) goto error;
- /*
- * Bulk load dynamic clients.
- */
- if (inst->do_clients) {
- CONF_SECTION *cs, *map, *tmpl;
-
- cs = cf_section_find(inst->cs, "client", NULL);
- if (!cs) {
- cf_log_err(conf, "Told to load clients but no client section found");
- goto error;
- }
-
- map = cf_section_find(cs, "attribute", NULL);
- if (!map) {
- cf_log_err(cs, "Told to load clients but no attribute section found");
- goto error;
- }
-
- tmpl = cf_section_find(cs, "template", NULL);
-
- if (rlm_ldap_client_load(inst, tmpl, map) < 0) {
- cf_log_err(cs, "Error loading clients");
-
- return -1;
- }
- }
-
fr_ldap_global_config(inst->ldap_debug, inst->tls_random_file);
return 0;
fr_dict_attr_t const *group_da; //!< The DA associated with this specific instance of the
//!< rlm_ldap module.
- /*
- * Dynamic clients
- */
- char const *clientobj_filter; //!< Filter to retrieve only client objects.
- char const *clientobj_base_dn; //!< DN to search for clients under.
- char const *clientobj_scope_str; //!< Scope (sub, one, base).
- int clientobj_scope; //!< Search scope.
-
- bool do_clients; //!< If true, attempt to load clients on instantiation.
-
/*
* Profiles
*/
void mod_conn_release(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_connection_t *conn);
void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval const *timeout);
-
-/*
- * clients.c - Dynamic clients (bulk load).
- */
-int rlm_ldap_client_load(rlm_ldap_t const *inst, CONF_SECTION *tmpl, CONF_SECTION *cs);
#endif