]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Support client_id variable
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 14 Mar 2017 08:01:51 +0000 (10:01 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Sun, 19 Mar 2017 18:11:53 +0000 (20:11 +0200)
When imap_id_retain is turned on, contains
the client ID request content with dovecot
special vars removed.

src/auth/auth-request-var-expand.c
src/auth/auth-request-var-expand.h

index a688e3209f1e01a3d0344da9d1549e55cda73c0b..f77870e67b2127caeedf2e19d9d15c484d5dc7b6 100644 (file)
@@ -46,6 +46,7 @@ auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1] = {
        { '\0', NULL, "auth_username" },
        { '\0', NULL, "auth_domain" },
        { '\0', NULL, "local_name" },
+       { '\0', NULL, "client_id" },
        /* be sure to update AUTH_REQUEST_VAR_TAB_COUNT */
        { '\0', NULL, NULL }
 };
@@ -171,6 +172,8 @@ auth_request_get_var_expand_table_full(const struct auth_request *auth_request,
                tab[32].value = escape_func(tab[32].value, auth_request);
        if (auth_request->local_name != NULL)
                tab[33].value = escape_func(auth_request->local_name, auth_request);
+       if (auth_request->client_id != NULL)
+               tab[34].value = escape_func(auth_request->client_id, auth_request);
        return ret_tab;
 }
 
index 7ad2b14a31cd7abab36c5dfffad8fd18c6eaf50a..5d450d05f6f905f7c4660b8c873af200558299d1 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 34
+#define AUTH_REQUEST_VAR_TAB_COUNT 35
 extern const struct var_expand_table
 auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1];