From: Stephan Bosch Date: Sat, 4 Mar 2023 17:08:46 +0000 (+0100) Subject: auth: mech-gssapi - Move mech_gssapi_initialize() X-Git-Tag: 2.4.2~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0dd711966439fb51ae764795d2f531fe0314b57;p=thirdparty%2Fdovecot%2Fcore.git auth: mech-gssapi - Move mech_gssapi_initialize() --- diff --git a/src/auth/mech-gssapi.c b/src/auth/mech-gssapi.c index fce2e24b77..922a4e0c13 100644 --- a/src/auth/mech-gssapi.c +++ b/src/auth/mech-gssapi.c @@ -73,6 +73,7 @@ static gss_OID_desc mech_gssapi_krb5_oid = static int mech_gssapi_wrap(struct gssapi_auth_request *request, gss_buffer_desc inbuf); +static void mech_gssapi_initialize(const struct auth_settings *set); static void mech_gssapi_log_error(struct auth_request *request, @@ -96,21 +97,6 @@ mech_gssapi_log_error(struct auth_request *request, } while (message_context != 0); } -static void mech_gssapi_initialize(const struct auth_settings *set) -{ - const char *path = set->krb5_keytab; - - if (*path != '\0') { - /* Environment may be used by Kerberos 5 library directly */ - env_put("KRB5_KTNAME", path); -#ifdef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY - gsskrb5_register_acceptor_identity(path); -#elif defined (HAVE_KRB5_GSS_REGISTER_ACCEPTOR_IDENTITY) - krb5_gss_register_acceptor_identity(path); -#endif - } -} - static struct auth_request *mech_gssapi_auth_new(void) { struct gssapi_auth_request *request; @@ -736,6 +722,21 @@ const struct mech_module mech_gssapi_spnego = { mech_gssapi_auth_free }; +static void mech_gssapi_initialize(const struct auth_settings *set) +{ + const char *path = set->krb5_keytab; + + if (*path != '\0') { + /* Environment may be used by Kerberos 5 library directly */ + env_put("KRB5_KTNAME", path); +#ifdef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY + gsskrb5_register_acceptor_identity(path); +#elif defined (HAVE_KRB5_GSS_REGISTER_ACCEPTOR_IDENTITY) + krb5_gss_register_acceptor_identity(path); +#endif + } +} + #ifndef BUILTIN_GSSAPI void mech_gssapi_init(void); void mech_gssapi_deinit(void);