From: Marco Bettini Date: Mon, 23 Jan 2023 16:24:33 +0000 (+0000) Subject: auth: Drop auth_fields_booleanize() X-Git-Tag: 2.4.0~3003 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7cc7eb9b4aaa3bf05ea36b1cf10e2bad29d8365;p=thirdparty%2Fdovecot%2Fcore.git auth: Drop auth_fields_booleanize() Booleanization is no longer necessary as now the fields expecting it expect just the field presence, not a specific value. --- diff --git a/src/auth/auth-fields.c b/src/auth/auth-fields.c index da1208c9f1..49193ae8b2 100644 --- a/src/auth/auth-fields.c +++ b/src/auth/auth-fields.c @@ -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; diff --git a/src/auth/auth-fields.h b/src/auth/auth-fields.h index 119689b311..adf50c5be2 100644 --- a/src/auth/auth-fields.h +++ b/src/auth/auth-fields.h @@ -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); diff --git a/src/auth/auth-request-handler.c b/src/auth/auth-request-handler.c index cb07270bbe..eeeda06af5 100644 --- a/src/auth/auth-request-handler.c +++ b/src/auth/auth-request-handler.c @@ -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);