]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10443 slap_sasl_mechs(): must mutex SASL call
authorKang Yang <kangyang126@gmail.com>
Fri, 6 Feb 2026 01:27:23 +0000 (01:27 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 6 Feb 2026 13:40:44 +0000 (13:40 +0000)
servers/slapd/sasl.c

index 2f40f9c1ec05276035095b3001a7f4cfb9a192ed..c6a71c6e3b9b6ad094fd6222a9429fd761d91ca6 100644 (file)
@@ -1548,11 +1548,13 @@ char ** slap_sasl_mechs( Connection *conn )
                int sc;
                SASL_CONST char *mechstr;
 
+               ldap_pvt_thread_mutex_lock( &conn->c_mutex );
                sc = sasl_listmech( ctx,
                        NULL, NULL, ",", NULL,
                        &mechstr, NULL, NULL );
 
                if( sc != SASL_OK ) {
+                       ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
                        Debug( LDAP_DEBUG_ANY, "slap_sasl_listmech failed: %d\n",
                                sc );
 
@@ -1560,6 +1562,7 @@ char ** slap_sasl_mechs( Connection *conn )
                }
 
                mechs = ldap_str2charray( mechstr, "," );
+               ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
        }
 #elif defined(SLAP_BUILTIN_SASL)
        /* builtin SASL implementation */