]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Add %{owner_user} alias for %{user}
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Thu, 14 Mar 2024 13:44:52 +0000 (14:44 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:59 +0000 (10:39 +0200)
src/auth/auth-request-var-expand.c
src/auth/auth-request-var-expand.h

index 32d654ed9373ecc66ebfcaa53d52907d0aaba95a..16db9bb2292b66971c6c3545a31883bd2a0f741b 100644 (file)
@@ -65,6 +65,7 @@ auth_request_var_expand_static_tab[] = {
        { '\0', NULL, "original_user" },
        { '\0', NULL, "original_username" },
        { '\0', NULL, "original_domain" },
+       { '\0', NULL, "owner_user" },
 
        /* be sure to update AUTH_REQUEST_VAR_TAB_COUNT */
        { '\0', NULL, NULL }
@@ -113,7 +114,7 @@ auth_request_get_var_expand_table_full(const struct auth_request *auth_request,
 
        if (username == NULL)
                username = "";
-       tab[0].value = escape_func(username, auth_request);
+       tab[0].value = tab[ALIAS(12)].value = escape_func(username, auth_request);
        tab[1].value = escape_func(t_strcut(username, '@'),
                                   auth_request);
        tab[2].value = i_strchr_to_next(username, '@');
index ab34b3143ca21558178f44386acb8ada368b8f02..f868dc58723b1db35a5b25865b93b708430feb4c 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 48
+#define AUTH_REQUEST_VAR_TAB_COUNT 49
 extern const struct var_expand_table
 auth_request_var_expand_static_tab[AUTH_REQUEST_VAR_TAB_COUNT+1];