]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: mech-gssapi - Move mech_gssapi_initialize()
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 4 Mar 2023 17:08:46 +0000 (18:08 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Oct 2025 08:41:22 +0000 (08:41 +0000)
src/auth/mech-gssapi.c

index fce2e24b779ef72ae3d5e76c4db1a9201d7bbbe8..922a4e0c134fc660518202fff0e47d7c672dbc22 100644 (file)
@@ -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);