]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Drop auth_fields_booleanize()
authorMarco Bettini <marco.bettini@open-xchange.com>
Mon, 23 Jan 2023 16:24:33 +0000 (16:24 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Thu, 2 Feb 2023 14:13:03 +0000 (14:13 +0000)
Booleanization is no longer necessary as now the fields expecting it
expect just the field presence, not a specific value.

src/auth/auth-fields.c
src/auth/auth-fields.h
src/auth/auth-request-handler.c

index da1208c9f138a3411e1cf9d8296254ed6e458cde..49193ae8b295f681be56b093241f036f501e07f8 100644 (file)
@@ -192,17 +192,6 @@ bool auth_fields_is_empty(struct auth_fields *fields)
                array_count(&fields->fields) == 0;
 }
 
-void auth_fields_booleanize(struct auth_fields *fields, const char *key)
-{
-       struct auth_field *field;
-       unsigned int idx;
-
-       if (auth_fields_find_idx(fields, key, &idx)) {
-               field = array_idx_modifiable(&fields->fields, idx);
-               field->value = "yes";
-       }
-}
-
 void auth_fields_snapshot(struct auth_fields *fields)
 {
        struct auth_field *field;
index 119689b3113342fdd3dbbc13d0a041570052340f..adf50c5be2d2e1fabb93ee565210667d5f5776b1 100644 (file)
@@ -37,9 +37,6 @@ void auth_fields_append(struct auth_fields *fields, string_t *dest,
                        enum auth_field_flags flags_mask,
                        enum auth_field_flags flags_result);
 bool auth_fields_is_empty(struct auth_fields *fields);
-/* If the field exists, set its value to "yes",
-   so the exported string will be "key=yes" */
-void auth_fields_booleanize(struct auth_fields *fields, const char *key);
 
 /* Remember the current fields. */
 void auth_fields_snapshot(struct auth_fields *fields);
index cb07270bbebe22f61146dd2fda6f96596909ef4f..eeeda06af56f8f993251d550e6b681309829ed70 100644 (file)
@@ -273,11 +273,6 @@ auth_request_handler_reply_success_finish(struct auth_request *request)
                auth_penalty_update(auth_penalty, request, 0);
        }
 
-       /* sanitize these fields, since the login code currently assumes they
-          are exactly in this format. */
-       auth_fields_booleanize(request->fields.extra_fields, "nologin");
-       auth_fields_booleanize(request->fields.extra_fields, "proxy");
-
        str_printfa(str, "OK\t%u\tuser=", request->id);
        str_append_tabescaped(str, request->fields.user);
        auth_str_append_extra_fields(request, str);