]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/cr.c
Change slap_sasl_authorized to take an Operation instead of a Connection,
[openldap] / servers / slapd / cr.c
index bbd3b349eedabd2b63a3544f59296a7446a37897..24c546e364bf3244951e2d9fd0e3b6eb0e00aae8 100644 (file)
@@ -116,6 +116,7 @@ cr_insert(
        struct cindexrec        *cir;
        char                    **names;
 
+       LDAP_SLIST_NEXT( scr, scr_next ) = NULL;
        LDAP_SLIST_INSERT_HEAD(&cr_list, scr, scr_next);
 
        if ( scr->scr_oid ) {
@@ -398,36 +399,34 @@ int
 cr_schema_info( Entry *e )
 {
 #ifdef SLAP_EXTENDED_SCHEMA
-       struct berval   vals[2];
-       ContentRule     *cr;
-
        AttributeDescription *ad_ditContentRules
                = slap_schema.si_ad_ditContentRules;
+       ContentRule     *cr;
 
-       vals[1].bv_val = NULL;
+       struct berval   val;
+       struct berval   nval;
 
        LDAP_SLIST_FOREACH(cr, &cr_list, scr_next) {
-               if ( ldap_contentrule2bv( &cr->scr_crule, vals ) == NULL ) {
+               if ( ldap_contentrule2bv( &cr->scr_crule, &val ) == NULL ) {
                        return -1;
                }
 
 #if 0
                if( cr->scr_flags & SLAP_CR_HIDE ) continue;
 #endif
-
 #if 0
                Debug( LDAP_DEBUG_TRACE, "Merging cr [%ld] %s\n",
-              (long) vals[0].bv_len, vals[0].bv_val, 0 );
-#endif
-#ifdef SLAP_NVALUES
-               if( attr_merge( e, ad_ditContentRules, vals, NULL ) )
-#else
-               if( attr_merge( e, ad_ditContentRules, vals ) )
+              (long) val.bv_len, val.bv_val, 0 );
 #endif
+
+               nval.bv_val = cr->scr_oid;
+               nval.bv_len = strlen(cr->scr_oid);
+
+               if( attr_merge_one( e, ad_ditContentRules, &val, &nval ) )
                {
                        return -1;
                }
-               ldap_memfree( vals[0].bv_val );
+               ldap_memfree( val.bv_val );
        }
 #endif
        return 0;