]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm auth -x: Allow either service=name or protocol=name filters
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 24 Jun 2023 21:05:47 +0000 (00:05 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:09 +0000 (12:34 +0200)
It's a bit ambiguous which is correct, so allow both. The name is used for
mail_storage_service as "service", but it ends up going to auth as
"protocol".

src/doveadm/doveadm-auth-server.c
src/doveadm/doveadm-auth.c

index d9011fd0fb134a391cfbb00479b47c9e016833ce..e0e69999eb42064a637db25ec469f9cf040c9fba 100644 (file)
@@ -119,7 +119,8 @@ static void auth_user_info_parse(struct auth_user_info *info, const char *arg)
 {
        const char *value;
 
-       if (str_begins(arg, "service=", &value))
+       if (str_begins(arg, "service=", &value) ||
+           str_begins(arg, "protocol=", &value))
                info->protocol = value;
        else if (str_begins(arg, "lip=", &value)) {
                if (net_addr2ip(value, &info->local_ip) < 0)
index 9d2765109c1db0855e73f69c45dc20b2a9d4306c..fb5bbbe84d0972f91806fead3499ef87000b11df 100644 (file)
@@ -347,7 +347,8 @@ auth_user_info_parse_arg(struct auth_user_info *info, const char *arg,
 {
        const char *key, *value;
 
-       if (str_begins(arg, "service=", &value))
+       if (str_begins(arg, "service=", &value) ||
+           str_begins(arg, "protocol=", &value))
                info->protocol = value;
        else if (str_begins(arg, "session=", &value))
                info->session_id = value;