]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Add %{mechanism} alias for %{mech}
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 4 Aug 2020 13:19:29 +0000 (16:19 +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 f77bb37a6e0e44c8bb7ce99a871bcc4db4bc146b..8a40f4fe6630b460449164e21c987996468c3c29 100644 (file)
@@ -57,6 +57,7 @@ auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1] = {
        { '\0', NULL, "real_remote_ip" },
        { '\0', NULL, "real_local_port" },
        { '\0', NULL, "real_remote_port" },
+       { '\0', NULL, "mechanism" },
 
        /* be sure to update AUTH_REQUEST_VAR_TAB_COUNT */
        { '\0', NULL, NULL }
@@ -127,7 +128,7 @@ auth_request_get_var_expand_table_full(const struct auth_request *auth_request,
                tab[9].value = auth_request->passdb == NULL ? "" :
                        dec2str(auth_request->passdb->passdb->id);
        }
-       tab[10].value = fields->mech_name == NULL ? "" :
+       tab[10].value = tab[43].value = fields->mech_name == NULL ? "" :
                escape_func(fields->mech_name, auth_request);
        switch (fields->secured) {
        case AUTH_REQUEST_SECURED_NONE: tab[11].value = ""; break;
index 6958e3621b137741c789613980e5e6cf62665971..3f78c8fe1de66102e47eb7515efe4c863ee67171 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 43
+#define AUTH_REQUEST_VAR_TAB_COUNT 44
 extern const struct var_expand_table
 auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1];