]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove clients loaded at module instantiate time
authorAlan T. DeKok <aland@freeradius.org>
Tue, 28 Nov 2017 18:47:31 +0000 (13:47 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 28 Nov 2017 18:48:04 +0000 (13:48 -0500)
raddb/mods-available/ldap
src/modules/rlm_ldap/all.mk
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_ldap/rlm_ldap.h

index f178be825edd1e89fa6460dbe40f5fcaf9fe9a13..43689bf2f1ae1948044bc2452f5a1912425567d6 100644 (file)
@@ -314,57 +314,6 @@ ldap {
 #              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
        #
index 73754dd929e957a18ca1fe155ec7bd29d0867f4b..aaf850177b7975fc97a477cdb26f7f255dbdeef0 100644 (file)
@@ -9,7 +9,7 @@ ifneq "${TARGETNAME}" ""
   TARGET       := $(TARGETNAME).a
 endif
 
-SOURCES                := $(TARGETNAME).c clients.c conn.c groups.c user.c
+SOURCES                := $(TARGETNAME).c conn.c groups.c user.c
 
 SRC_CFLAGS     += -I$(top_builddir)/src/modules/rlm_ldap
 TGT_PREREQS    := libfreeradius-ldap.a
index 141a2db4d01ba3496be1823876e2abc2696214e3..88b3a7299c15ea2d7ce745655b55d4ae7993ad16 100644 (file)
@@ -117,13 +117,6 @@ static CONF_PARSER group_config[] = {
        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
  */
@@ -214,14 +207,10 @@ static const CONF_PARSER module_config[] = {
        { 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 },
@@ -1846,18 +1835,6 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf)
                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
@@ -1932,33 +1909,6 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf)
                                                 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;
index a9ece6ac2eff6aec11e10c029f9d7aeebd150db0..e1852a02874aaff086ff1f94dd9a993926bd6a5b 100644 (file)
@@ -111,16 +111,6 @@ struct ldap_inst_s {
        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
         */
@@ -195,9 +185,4 @@ fr_ldap_connection_t        *mod_conn_get(rlm_ldap_t const *inst, REQUEST *request);
 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