]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/at.c
Fallout from ITS#4986 - remove unused param of select_backend()
[openldap] / servers / slapd / at.c
index 047d6498390279a92651a6987624e3f0b3de396d..e70f10e969ba1eaaa5a1e59fec80366a3c6fdb82 100644 (file)
@@ -459,6 +459,7 @@ at_insert(
                                
                                /* Keep old oid, free new oid;
                                 * Keep old ads, free new ads;
+                                * Keep old ad_mutex, free new ad_mutex;
                                 * Keep new everything else, free old
                                 */
                                tmp = *old_sat;
@@ -467,6 +468,8 @@ at_insert(
                                tmp.sat_oid = sat->sat_oid;
                                old_sat->sat_ad = tmp.sat_ad;
                                tmp.sat_ad = sat->sat_ad;
+                               old_sat->sat_ad_mutex = tmp.sat_ad_mutex;
+                               tmp.sat_ad_mutex = sat->sat_ad_mutex;
                                *sat = tmp;
 
                                /* Check for basic ad pointing at old cname */
@@ -751,9 +754,12 @@ at_add(
                        goto error_return;
                }
 
-               if( sat->sat_syntax != NULL && sat->sat_syntax != syn ) {
-                       code = SLAP_SCHERR_ATTR_BAD_SUP;
-                       goto error_return;
+               if ( sat->sat_syntax != NULL && sat->sat_syntax != syn ) {
+                       /* BEWARE: no loop detection! */
+                       if ( syn_is_sup( sat->sat_syntax, syn ) ) {
+                               code = SLAP_SCHERR_ATTR_BAD_SUP;
+                               goto error_return;
+                       }
                }
 
                sat->sat_syntax = syn;