]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-ldap: dict_ldap_map_settings - Rename scope_val into parsed_scope
authorMarco Bettini <marco.bettini@open-xchange.com>
Wed, 11 Sep 2024 09:54:23 +0000 (09:54 +0000)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:01 +0000 (10:40 +0200)
src/lib-dict-backend/dict-ldap-settings.c
src/lib-dict-backend/dict-ldap-settings.h
src/lib-dict-backend/dict-ldap.c

index 31dcd3b89ab594b744c347cb510e2cff97bdd10e..76bd97503c83832666b40a3ca76d5ca23284e026 100644 (file)
@@ -153,11 +153,11 @@ static const char *dict_ldap_map_finish(struct setting_parser_ctx *ctx)
                ctx->cur_map.username_attribute = dict_ldap_commonName;
        }
        if (ctx->cur_map.scope == NULL) {
-               ctx->cur_map.scope_val = 2; /* subtree */
+               ctx->cur_map.parsed_scope = 2; /* subtree */
        } else {
-               if (strcasecmp(ctx->cur_map.scope, "one") == 0) ctx->cur_map.scope_val = 1;
-               else if (strcasecmp(ctx->cur_map.scope, "base") == 0) ctx->cur_map.scope_val = 0;
-               else if (strcasecmp(ctx->cur_map.scope, "subtree") == 0) ctx->cur_map.scope_val = 2;
+               if (strcasecmp(ctx->cur_map.scope, "one") == 0) ctx->cur_map.parsed_scope = 1;
+               else if (strcasecmp(ctx->cur_map.scope, "base") == 0) ctx->cur_map.parsed_scope = 0;
+               else if (strcasecmp(ctx->cur_map.scope, "subtree") == 0) ctx->cur_map.parsed_scope = 2;
                else return "Scope must be one, base or subtree";
        }
        if (!array_is_created(&ctx->cur_map.ldap_attributes)) {
index 621d86fbbb5fc6b59020747d0a6b07d95676fe45..12f72f963bc6c1477cf5b38379131d39716156f0 100644 (file)
@@ -10,10 +10,12 @@ struct dict_ldap_map_settings {
        const char *value_attribute;
        const char *base;
        const char *scope;
-       int scope_val;
        unsigned int timeout;
 
        ARRAY_TYPE(const_string) ldap_attributes;
+
+       /* parsed */
+       int parsed_scope;
 };
 
 struct dict_ldap_settings {
index 621573b45069ae0b75846948d1c88ba0f722b8e5..b02f7ced469d4de40f5879b1425926f89399cb61 100644 (file)
@@ -431,7 +431,7 @@ void ldap_dict_lookup_async(struct dict *dict,
                /* build lookup */
                i_zero(&input);
                input.base_dn = map->base;
-               input.scope = map->scope_val;
+               input.scope = map->parsed_scope;
                if (!ldap_dict_build_query(set, map, &values, strncmp(key, DICT_PATH_PRIVATE, strlen(DICT_PATH_PRIVATE))==0, query, &error)) {
                        op->res.error = error;
                        callback(&op->res, context);