]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Add %{original_*} aliases for %{orig_*}
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 4 Aug 2020 13:45:19 +0000 (16:45 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 27 Aug 2020 06:20:17 +0000 (06:20 +0000)
src/auth/auth-request-var-expand.c
src/auth/auth-request-var-expand.h

index 8a40f4fe6630b460449164e21c987996468c3c29..65eac7673333f677280a7704c83bf5813d818099 100644 (file)
@@ -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;
index 3f78c8fe1de66102e47eb7515efe4c863ee67171..ddad1d4d356be201bb2bcd693f293b541c2be103 100644 (file)
@@ -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];