From: Timo Sirainen Date: Tue, 4 Aug 2020 13:45:19 +0000 (+0300) Subject: auth: Add %{original_*} aliases for %{orig_*} X-Git-Tag: 2.3.13~333 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2522e957e125a5a99e2068d15a94841b398a1d6f;p=thirdparty%2Fdovecot%2Fcore.git auth: Add %{original_*} aliases for %{orig_*} --- diff --git a/src/auth/auth-request-var-expand.c b/src/auth/auth-request-var-expand.c index 8a40f4fe66..65eac76733 100644 --- a/src/auth/auth-request-var-expand.c +++ b/src/auth/auth-request-var-expand.c @@ -58,6 +58,9 @@ auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1] = { { '\0', NULL, "real_local_port" }, { '\0', NULL, "real_remote_port" }, { '\0', NULL, "mechanism" }, + { '\0', NULL, "original_user" }, + { '\0', NULL, "original_username" }, + { '\0', NULL, "original_domain" }, /* be sure to update AUTH_REQUEST_VAR_TAB_COUNT */ { '\0', NULL, NULL } @@ -177,11 +180,12 @@ auth_request_get_var_expand_table_full(const struct auth_request *auth_request, orig_user = fields->original_username != NULL ? fields->original_username : username; - tab[27].value = escape_func(orig_user, auth_request); - tab[28].value = escape_func(t_strcut(orig_user, '@'), auth_request); - tab[29].value = i_strchr_to_next(orig_user, '@'); + tab[27].value = tab[44].value = escape_func(orig_user, auth_request); + tab[28].value = tab[45].value = escape_func(t_strcut(orig_user, '@'), auth_request); + tab[29].value = tab[46].value = i_strchr_to_next(orig_user, '@'); if (tab[29].value != NULL) - tab[29].value = escape_func(tab[29].value, auth_request); + tab[29].value = tab[46].value = + escape_func(tab[29].value, auth_request); if (fields->master_user != NULL) auth_user = fields->master_user; diff --git a/src/auth/auth-request-var-expand.h b/src/auth/auth-request-var-expand.h index 3f78c8fe1d..ddad1d4d35 100644 --- a/src/auth/auth-request-var-expand.h +++ b/src/auth/auth-request-var-expand.h @@ -8,7 +8,7 @@ auth_request_escape_func_t(const char *string, #define AUTH_REQUEST_VAR_TAB_USER_IDX 0 #define AUTH_REQUEST_VAR_TAB_USERNAME_IDX 1 #define AUTH_REQUEST_VAR_TAB_DOMAIN_IDX 2 -#define AUTH_REQUEST_VAR_TAB_COUNT 44 +#define AUTH_REQUEST_VAR_TAB_COUNT 47 extern const struct var_expand_table auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1];