From d38b0a9df563cb9a00775457e1d4934482727413 Mon Sep 17 00:00:00 2001 From: Marco Bettini Date: Fri, 19 May 2023 09:50:45 +0000 Subject: [PATCH] auth: user_callback() - Check if the user is anonymous --- src/auth/auth-master-connection.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/auth/auth-master-connection.c b/src/auth/auth-master-connection.c index 476515449e..7e7d8b002b 100644 --- a/src/auth/auth-master-connection.c +++ b/src/auth/auth-master-connection.c @@ -299,6 +299,14 @@ user_callback(enum userdb_result result, str_append_tabescaped(str, auth_request->fields.user); auth_fields_append(auth_request->fields.userdb_reply, str, AUTH_FIELD_FLAG_HIDDEN, 0, TRUE); + if (*auth_request->set->anonymous_username != '\0' && + strcmp(auth_request->fields.user, + auth_request->set->anonymous_username) == 0) { + /* this is an anonymous login, either via ANONYMOUS + SASL mechanism or simply logging in as the anonymous + user via another mechanism */ + str_append(str, "\tanonymous"); + } break; } -- 2.47.3