From: Stephan Bosch Date: Thu, 28 May 2020 21:10:41 +0000 (+0200) Subject: lib-auth: auth-master - Support sending extra_fields. X-Git-Tag: 2.3.13~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ac4b3b5d2200487099c9d17e022d047e7238668;p=thirdparty%2Fdovecot%2Fcore.git lib-auth: auth-master - Support sending extra_fields. --- diff --git a/src/lib-auth/auth-master.c b/src/lib-auth/auth-master.c index e88bd83e61..8073558263 100644 --- a/src/lib-auth/auth-master.c +++ b/src/lib-auth/auth-master.c @@ -523,6 +523,8 @@ auth_master_next_request_id(struct auth_master_connection *conn) void auth_user_info_export(string_t *str, const struct auth_user_info *info) { + const char *const *fieldp; + if (info->service != NULL) { str_append(str, "\tservice="); str_append(str, info->service); @@ -555,6 +557,12 @@ void auth_user_info_export(string_t *str, const struct auth_user_info *info) str_append(str, "\tforward_fields="); str_append_tabescaped(str, info->forward_fields); } + if (array_is_created(&info->extra_fields)) { + array_foreach(&info->extra_fields, fieldp) { + str_append_c(str, '\t'); + str_append_tabescaped(str, *fieldp); + } + } } static void diff --git a/src/lib-auth/auth-master.h b/src/lib-auth/auth-master.h index 6926acbed7..5a1a136f2d 100644 --- a/src/lib-auth/auth-master.h +++ b/src/lib-auth/auth-master.h @@ -15,6 +15,7 @@ struct auth_user_info { struct ip_addr local_ip, remote_ip, real_local_ip, real_remote_ip; in_port_t local_port, remote_port, real_local_port, real_remote_port; const char *forward_fields; + ARRAY_TYPE(const_string) extra_fields; bool debug; };