From: Timo Sirainen Date: Tue, 30 May 2017 13:57:45 +0000 (+0300) Subject: auth: Don't lose all forward_ fields if the first passdb lookup fails. X-Git-Tag: 2.3.0.rc1~1538 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ce76629d27427c4c643fb2c40d37adc13ff127c;p=thirdparty%2Fdovecot%2Fcore.git auth: Don't lose all forward_ fields if the first passdb lookup fails. --- diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index b850fe0917..38315b1c74 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -408,10 +408,13 @@ bool auth_request_import_info(struct auth_request *request, request->debug = TRUE; else if (strcmp(key, "client_id") == 0) request->client_id = p_strdup(request->pool, value); - else if (strcmp(key, "forward_fields") == 0) + else if (strcmp(key, "forward_fields") == 0) { auth_fields_import_prefixed(request->extra_fields, "forward_", value, 0); - else + /* make sure the forward_ fields aren't deleted by + auth_fields_rollback() if the first passdb lookup fails. */ + auth_fields_snapshot(request->extra_fields); + } else return FALSE; /* NOTE: keep in sync with auth_request_export() */ return TRUE;