]> git.sur5r.net Git - openldap/commitdiff
SLAP_BVALUES fixes
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Feb 2003 00:48:37 +0000 (00:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Feb 2003 00:48:37 +0000 (00:48 +0000)
servers/slapd/entry.c
servers/slapd/tools/slapadd.c

index 23d58ed75873c70d80b00bbadf24c1dcc0a753dc..346bb87b83b8c0fcc76b0825b4d0c1313aea542c 100644 (file)
@@ -46,7 +46,7 @@ str2entry( char *s )
        char            *type;
        struct berval   vals[2];
 #ifdef SLAP_NVALUES
-       struct berval   nvals[2];
+       struct berval   nvals[2], *nvalsp;
 #endif
        AttributeDescription *ad;
        const char *text;
@@ -92,6 +92,7 @@ str2entry( char *s )
        e->e_id = NOID;
 
        /* dn + attributes */
+       vals[1].bv_len = 0;
        vals[1].bv_val = NULL;
 
        next = s;
@@ -239,7 +240,14 @@ str2entry( char *s )
                }
 
 #ifdef SLAP_NVALUES
-               if( ad->ad_type->sat_syntax->ssyn_normalize ) {
+               nvalsp = NULL;
+               nvals[0].bv_val = NULL;
+
+#if 0
+               if( ad->ad_type->sat_equality &&
+                       ad->ad_type->sat_equality->smr_match &&
+                       ad->ad_type->sat_syntax->ssyn_normalize )
+               {
                        rc = ad->ad_type->sat_syntax->ssyn_normalize(
                                ad->ad_type->sat_syntax,
                                &vals[0], &nvals[0] );
@@ -259,20 +267,19 @@ str2entry( char *s )
                        }
 #endif
 
-               } else {
-                       nvals[0].bv_len = 0;
-                       nvals[0].bv_val = NULL;
-               }
+                       nvals[1].bv_len = 0;
+                       nvals[1].bv_val = NULL;
 
-               nvals[1].bv_len = 0;
-               nvals[1].bv_val = NULL;
+                       nvalsp = &nvals[0];
+               }
+#endif
 #endif
 
-               rc = attr_merge( e, ad, vals
 #ifdef SLAP_NVALUES
-                       , nvals
+               rc = attr_merge( e, ad, vals, nvalsp );
+#else
+               rc = attr_merge( e, ad, vals );
 #endif
-                       );
                if( rc != 0 ) {
 #ifdef NEW_LOGGING
                        LDAP_LOG( OPERATION, DETAIL1,
index 72e9121a0a53c5102fb80fcde94ad485f7143dac..af26cdd4e77cbec0c300431d35e0dd63a6d067a2 100644 (file)
@@ -135,10 +135,12 @@ main( int argc, char **argv )
                                        break;
                                }
 
+                               vals[1].bv_len = 0;
                                vals[1].bv_val = NULL;
+
 #ifdef SLAP_NVALUES
-                               attr_merge( e, slap_schema.si_ad_structuralObjectClass, vals,
-                                       NULL /* FIXME */ );
+                               attr_merge( e, slap_schema.si_ad_structuralObjectClass,
+                                       vals, NULL /* FIXME */ );
 #else
                                attr_merge( e, slap_schema.si_ad_structuralObjectClass, vals );
 #endif
@@ -209,7 +211,7 @@ main( int argc, char **argv )
                                vals[0].bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) );
                                vals[0].bv_val = uuidbuf;
 #ifdef SLAP_NVALUES
-                               attr_merge( e, slap_schema.si_ad_entryUUID, vals, vals );
+                               attr_merge( e, slap_schema.si_ad_entryUUID, vals, NULL );
 #else
                                attr_merge( e, slap_schema.si_ad_entryUUID, vals );
 #endif