]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9264 more for unique locking
authorHoward Chu <hyc@openldap.org>
Mon, 25 May 2020 21:38:30 +0000 (22:38 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 25 May 2020 21:38:30 +0000 (22:38 +0100)
servers/slapd/overlays/unique.c

index 69e026a7b0c28952c1a7ad2bfa3154b6c2b678e5..17344e1cd4186fb65d349f5d9c8aefc4da6184f2 100644 (file)
@@ -1121,8 +1121,10 @@ unique_add(
                        /* skip this domain-uri if it isn't involved */
                        if ( !ks ) continue;
 
-                       if ( domain->serial && !locked )
+                       if ( domain->serial && !locked ) {
                                ldap_pvt_thread_mutex_lock( &private->serial_mutex );
+                               locked = 1;
+                       }
 
                        /* terminating NUL */
                        ks += sizeof("(|)");
@@ -1259,8 +1261,10 @@ unique_modify(
                        /* skip this domain-uri if it isn't involved */
                        if ( !ks ) continue;
 
-                       if ( domain->serial && !locked )
+                       if ( domain->serial && !locked ) {
                                ldap_pvt_thread_mutex_lock( &private->serial_mutex );
+                               locked = 1;
+                       }
 
                        /* terminating NUL */
                        ks += sizeof("(|)");
@@ -1425,8 +1429,10 @@ unique_modrdn(
                        /* skip this domain if it isn't involved */
                        if ( !ks ) continue;
 
-                       if ( domain->serial && !locked )
+                       if ( domain->serial && !locked ) {
                                ldap_pvt_thread_mutex_lock( &private->serial_mutex );
+                               locked = 1;
+                       }
 
                        /* terminating NUL */
                        ks += sizeof("(|)");