]> git.sur5r.net Git - openldap/commitdiff
Working test001 and test002.
authorKurt Zeilenga <kurt@openldap.org>
Sat, 27 May 2000 19:21:28 +0000 (19:21 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 27 May 2000 19:21:28 +0000 (19:21 +0000)
servers/slapd/back-ldbm/search.c
servers/slapd/schema/core.schema
servers/slapd/schemaparse.c

index ced37b8265ffc593c9656cf761a1cb84613f3f25..8a09394b3b39e6a7c26807b38976f5c35e187bb9 100644 (file)
@@ -138,6 +138,7 @@ ldbm_back_search(
 
        /* need normalized dn below */
        realbase = ch_strdup( e->e_ndn );
+
        cache_return_entry_r( &li->li_cache, e );
 
        if ( candidates == NULL ) {
@@ -400,15 +401,20 @@ search_candidates(
 )
 {
        ID_BLOCK                *candidates;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       candidates = filter_candidates( be, filter );
+#else
+
        Filter          rf, rf_or, af, af_or, lf, lf_and;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       struct berval rf_or_bv, af_or_bv;
-       static AttributeDescription *objectClass = NULL;
+       AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass;
 #endif
 
        Debug(LDAP_DEBUG_TRACE, "search_candidates: base=\"%s\" s=%d d=%d\n",
                e->e_ndn, scope, deref );
+#endif
 
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        if( !manageDSAit ) {
                /* match referrals */
                rf.f_next = NULL;
@@ -416,10 +422,8 @@ search_candidates(
                rf.f_or = &rf_or;
                rf.f_or->f_choice = LDAP_FILTER_EQUALITY;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-               rf.f_or->f_av_desc = objectClass;
-               rf.f_or->f_av_value = &rf_or_bv;
-               rf.f_or->f_av_value->bv_val = ch_strdup( "REFERRAL" );
-               rf.f_or->f_av_value->bv_len = sizeof("REFERRAL")-1;
+               rf.f_or->f_av_desc = ad_objectClass;
+               rf.f_or->f_av_value = ber_bvstrdup("REFERRAL");
 #else
                rf.f_or->f_avtype = ch_strdup( "objectclass" );
                rf.f_or->f_avvalue.bv_val = ch_strdup( "REFERRAL" );
@@ -439,9 +443,7 @@ search_candidates(
                af.f_or->f_choice = LDAP_FILTER_EQUALITY;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
                af.f_or->f_av_desc = objectClass;
-               af.f_or->f_av_value = &af_or_bv;
-               af.f_or->f_av_value->bv_val = ch_strdup( "ALIAS" );
-               af.f_or->f_av_value->bv_len = sizeof("ALIAS")-1;
+               af.f_or->f_av_value = ber_bvstrdup("ALIAS");
 #else
                af.f_or->f_avtype = ch_strdup( "objectclass" );
                af.f_or->f_avvalue.bv_val = ch_strdup( "ALIAS" );
@@ -477,7 +479,7 @@ search_candidates(
        /* free dynamically allocated bits */
        if( af.f_or != NULL ) {
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-               free( af.f_or->f_av_value->bv_val );
+               ber_bvfree( af.f_or->f_av_value );
 #else
                free( af.f_or->f_avtype );
                free( af.f_or->f_avvalue.bv_val );
@@ -486,12 +488,13 @@ search_candidates(
 
        if( rf.f_or != NULL ) {
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-               free( rf.f_or->f_av_value->bv_val );
+               ber_bvfree( rf.f_or->f_av_value );
 #else
                free( rf.f_or->f_avtype );
                free( rf.f_or->f_avvalue.bv_val );
 #endif
        }
 
+#endif
        return( candidates );
 }
index 06cfe644b13302b1a7eff7807534c92e42d7b487..36c80caf9d82e0122a02923b652b0cbcf20bec9a 100644 (file)
@@ -292,7 +292,7 @@ attributetype ( 2.5.4.40 NAME 'crossCertificatePair'
 
 # 2.5.4.41 is 'name', moved above since other attribute types derive from it
 
-attributetype ( 2.5.4.42 NAME 'givenName' SUP name )
+attributetype ( 2.5.4.42 NAME ( 'givenName' 'gn' ) SUP name )
 
 attributetype ( 2.5.4.43 NAME 'initials' SUP name )
 
index 93cf2e5a14da37af53df665631371378f93777e4..68bc0ae31bdbd41fbd2ba8a7886e98ced5221ad2 100644 (file)
@@ -27,15 +27,15 @@ static void         at_usage(void)     LDAP_GCCATTR((noreturn));
 static char *const err2text[] = {
        "",
        "Out of memory",
-       "Objectclass not found",
-       "Attribute type not found",
-       "Duplicate objectclass",
-       "Duplicate attributetype",
-       "Duplicate syntax",
-       "Duplicate matchingrule",
+       "ObjectClass not found",
+       "AttributeType not found",
+       "Duplicate objectClass",
+       "Duplicate attributeType",
+       "Duplicate ldapSyntax",
+       "Duplicate matchingRule",
        "OID or name required",
-       "Syntax or superior required",
-       "Matchingrule not found",
+       "SYNTAX or SUPerior required",
+       "MatchingRule not found",
        "Syntax not found",
        "Syntax required"
 };
@@ -123,7 +123,7 @@ parse_oc_old(
                for( namep = oc->oc_at_oids_must; *namep ; namep++ ) {
                        code = at_fake_if_needed( *namep );
                        if ( code ) {
-                               fprintf( stderr, "%s: line %d: %s %s\n",
+                               fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                                         fname, lineno, scherr2str(code), *namep);
                                exit( EXIT_FAILURE );
                        }
@@ -133,7 +133,7 @@ parse_oc_old(
                for( namep = oc->oc_at_oids_may; *namep; namep++ ) {
                        code = at_fake_if_needed( *namep );
                        if ( code ) {
-                               fprintf( stderr, "%s: line %d: %s %s\n",
+                               fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                                         fname, lineno, scherr2str(code), *namep);
                                exit( EXIT_FAILURE );
                        }
@@ -142,7 +142,7 @@ parse_oc_old(
        
        code = oc_add(oc,&err);
        if ( code ) {
-               fprintf( stderr, "%s: line %d: %s %s\n",
+               fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                         fname, lineno, scherr2str(code), err);
                exit( EXIT_FAILURE );
        }
@@ -298,7 +298,7 @@ parse_oc(
        /* oc->oc_oid == NULL will be an error someday */
        code = oc_add(oc,&err);
        if ( code ) {
-               fprintf( stderr, "%s: line %d: %s %s\n",
+               fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                         fname, lineno, scherr2str(code), err);
                exit( EXIT_FAILURE );
        }
@@ -428,7 +428,7 @@ parse_at(
        }
        code = at_add(at,&err);
        if ( code ) {
-               fprintf( stderr, "%s: line %d: %s %s\n",
+               fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                         fname, lineno, scherr2str(code), err);
                exit( EXIT_FAILURE );
        }