From: Stephan Bosch Date: Mon, 30 Oct 2023 02:11:31 +0000 (+0100) Subject: auth: mech - Move MAX_MECH_NAME_LEN to auth-sasl and add prefix X-Git-Tag: 2.4.2~298 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1a977008fe20b4bb8c13bd2a234771d2681cf8c;p=thirdparty%2Fdovecot%2Fcore.git auth: mech - Move MAX_MECH_NAME_LEN to auth-sasl and add prefix --- diff --git a/src/auth/auth-request-handler.c b/src/auth/auth-request-handler.c index 6e007852be..241a5eef65 100644 --- a/src/auth/auth-request-handler.c +++ b/src/auth/auth-request-handler.c @@ -11,6 +11,7 @@ #include "strescape.h" #include "str-sanitize.h" #include "master-interface.h" +#include "auth-sasl.h" #include "auth-penalty.h" #include "auth-request.h" #include "auth-token.h" @@ -593,7 +594,8 @@ int auth_request_handler_auth_begin(struct auth_request_handler *handler, e_error(handler->conn->conn.event, "BUG: Authentication client %u requested invalid " "authentication mechanism %s (DOVECOT-TOKEN required)", - handler->client_pid, str_sanitize(args[1], MAX_MECH_NAME_LEN)); + handler->client_pid, + str_sanitize(args[1], AUTH_SASL_MAX_MECH_NAME_LEN)); return -1; } } else { @@ -604,7 +606,7 @@ int auth_request_handler_auth_begin(struct auth_request_handler *handler, e_error(handler->conn->conn.event, "BUG: Authentication client %u requested unsupported " "authentication mechanism %s", handler->client_pid, - str_sanitize(args[1], MAX_MECH_NAME_LEN)); + str_sanitize(args[1], AUTH_SASL_MAX_MECH_NAME_LEN)); return -1; } } diff --git a/src/auth/auth-sasl.h b/src/auth/auth-sasl.h index 692832a999..30b71be944 100644 --- a/src/auth/auth-sasl.h +++ b/src/auth/auth-sasl.h @@ -1,6 +1,9 @@ #ifndef AUTH_SASL_H #define AUTH_SASL_H +/* Used only for string sanitization. */ +#define AUTH_SASL_MAX_MECH_NAME_LEN 64 + struct auth_sasl_mech_module { const char *mech_name; }; diff --git a/src/auth/mech.h b/src/auth/mech.h index 905d9e0857..ffd7838da9 100644 --- a/src/auth/mech.h +++ b/src/auth/mech.h @@ -9,9 +9,6 @@ struct auth_request; #include "auth-request.h" #include "auth-request-handler.h" -/* Used only for string sanitization. */ -#define MAX_MECH_NAME_LEN 64 - enum mech_passdb_need { /* Mechanism doesn't need a passdb at all */ MECH_PASSDB_NEED_NOTHING = 0,