]> git.sur5r.net Git - openldap/commitdiff
Sync with HEAD
authorKurt Zeilenga <kurt@openldap.org>
Mon, 12 Apr 2004 20:13:20 +0000 (20:13 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 12 Apr 2004 20:13:20 +0000 (20:13 +0000)
22 files changed:
servers/slapd/acl.c
servers/slapd/aclparse.c
servers/slapd/attr.c
servers/slapd/ava.c
servers/slapd/bind.c
servers/slapd/compare.c
servers/slapd/connection.c
servers/slapd/daemon.c
servers/slapd/dn.c
servers/slapd/filterentry.c
servers/slapd/ldapsync.c
servers/slapd/main.c
servers/slapd/matchedValues.c
servers/slapd/mra.c
servers/slapd/referral.c
servers/slapd/repl.c
servers/slapd/schema_check.c
servers/slapd/schema_init.c
servers/slapd/search.c
servers/slapd/slapadd.c
servers/slapd/slapcommon.c
servers/slapd/value.c

index e5db4a6cfd4f4f34d2ccec6d2c00eb03c418d1ec..c337b8fe78ee8e21c61085933a4dbdda32b2362a 100644 (file)
@@ -1207,7 +1207,7 @@ dn_match_cleanup:;
 
                if ( b->a_group_pat.bv_len ) {
                        struct berval bv;
-                       struct berval ndn = { 0, NULL };
+                       struct berval ndn = BER_BVNULL;
                        int rc;
 
                        if ( op->o_ndn.bv_len == 0 ) {
@@ -1632,12 +1632,12 @@ acl_check_modlist(
                                goto done;
                        }
 
-                       if ( mlist->sml_bvalues == NULL ) break;
+                       if ( mlist->sml_values == NULL ) break;
 
                        /* fall thru to check value to add */
 
                case LDAP_MOD_ADD:
-                       assert( mlist->sml_bvalues != NULL );
+                       assert( mlist->sml_values != NULL );
 
                        for ( bv = mlist->sml_nvalues
                                        ? mlist->sml_nvalues : mlist->sml_values;
@@ -1653,7 +1653,7 @@ acl_check_modlist(
                        break;
 
                case LDAP_MOD_DELETE:
-                       if ( mlist->sml_bvalues == NULL ) {
+                       if ( mlist->sml_values == NULL ) {
                                if ( ! access_allowed( op, e,
                                        mlist->sml_desc, NULL, ACL_WRITE, NULL ) )
                                {
@@ -1763,14 +1763,14 @@ aci_match_set (
        int setref
 )
 {
-       struct berval set = { 0, NULL };
+       struct berval set = BER_BVNULL;
        int rc = 0;
        AciSetCookie cookie;
 
        if (setref == 0) {
                ber_dupbv_x( &set, subj, op->o_tmpmemctx );
        } else {
-               struct berval subjdn, ndn = { 0, NULL };
+               struct berval subjdn, ndn = BER_BVNULL;
                struct berval setat;
                BerVarray bvals;
                const char *text;
index 61dda94b37ae62207041095f3b78e03cd26ec6a3..b21fab1ff666a06c0d9250df0790061d9ac2a8d6 100644 (file)
@@ -1875,7 +1875,7 @@ print_acl( Backend *be, AccessControl *a )
        }
 
        if ( a->acl_filter != NULL ) {
-               struct berval bv = { 0, NULL };
+               struct berval bv = BER_BVNULL;
                to++;
                filter2bv( a->acl_filter, &bv );
                fprintf( stderr, " filter=%s\n", bv.bv_val );
index cb1e5ccb6c8918187b236ff478fe1aa7914c2d3c..69ca9f143980188a27a6014b8e7fa686f0af4278 100644 (file)
@@ -142,8 +142,8 @@ attr_merge(
        Entry           *e,
        AttributeDescription *desc,
        BerVarray       vals,
-       BerVarray       nvals
-{
+       BerVarray       nvals )
+{
        int rc;
 
        Attribute       **a;
@@ -176,8 +176,8 @@ attr_merge_normalize(
        Entry           *e,
        AttributeDescription *desc,
        BerVarray       vals,
-       void     *memctx
-{
+       void     *memctx )
+{
        BerVarray       nvals = NULL;
        int             rc;
 
@@ -218,8 +218,8 @@ attr_merge_one(
        Entry           *e,
        AttributeDescription *desc,
        struct berval   *val,
-       struct berval   *nval
-{
+       struct berval   *nval )
+{
        int rc;
        Attribute       **a;
 
@@ -250,8 +250,8 @@ attr_merge_normalize_one(
        Entry           *e,
        AttributeDescription *desc,
        struct berval   *val,
-       void            *memctx
-{
+       void            *memctx )
+{
        struct berval   nval;
        struct berval   *nvalp;
        int             rc;
@@ -288,8 +288,7 @@ attr_merge_normalize_one(
 Attribute *
 attrs_find(
     Attribute  *a,
-       AttributeDescription *desc
-)
+       AttributeDescription *desc )
 {
        for ( ; a != NULL; a = a->a_next ) {
                if ( is_ad_subtype( a->a_desc, desc ) ) {
@@ -307,8 +306,7 @@ attrs_find(
 Attribute *
 attr_find(
     Attribute  *a,
-       AttributeDescription *desc
-)
+       AttributeDescription *desc )
 {
        for ( ; a != NULL; a = a->a_next ) {
                if ( ad_cmp( a->a_desc, desc ) == 0 ) {
@@ -329,8 +327,7 @@ attr_find(
 int
 attr_delete(
     Attribute  **attrs,
-       AttributeDescription *desc
-)
+       AttributeDescription *desc )
 {
        Attribute       **a;
 
index 754f7ec53f85964012eda768bf6a54c740e002fd..57c79e794135f05840e87581ae2a2c8666191a3e 100644 (file)
@@ -53,8 +53,7 @@ get_ava(
        BerElement      *ber,
        AttributeAssertion      **ava,
        unsigned usage,
-       const char **text
-)
+       const char **text )
 {
        int rc;
        ber_tag_t rtag;
index c360ea30431977b047ffa5d6dfb5ee3a6c56da59..1423aca172aa19b10c948930a2976ce101c27c80 100644 (file)
@@ -47,8 +47,8 @@ do_bind(
        BerElement *ber = op->o_ber;
        ber_int_t version;
        ber_tag_t method;
-       struct berval mech = { 0, NULL };
-       struct berval dn = { 0, NULL };
+       struct berval mech = BER_BVNULL;
+       struct berval dn = BER_BVNULL;
        ber_tag_t tag;
        Backend *be = NULL;
 
index 8414ad20f2842f95d6c784a1928f2919f5518288..9c483a7a677d71e6e39d8a662e61616d8d4d88a9 100644 (file)
@@ -47,10 +47,10 @@ do_compare(
 )
 {
        Entry *entry = NULL;
-       struct berval dn = { 0, NULL };
-       struct berval desc = { 0, NULL };
-       struct berval value = { 0, NULL };
-       AttributeAssertion ava = { NULL, { 0, NULL } };
+       struct berval dn = BER_BVNULL;
+       struct berval desc = BER_BVNULL;
+       struct berval value = BER_BVNULL;
+       AttributeAssertion ava = { NULL, BER_BVNULL };
        int manageDSAit;
 
        ava.aa_desc = NULL;
index b829d2c8ca48b28a30215c2d8a8db8a1354a938d..ffcb0312c584ffb32246582326acf12961ffe0f8 100644 (file)
@@ -1318,7 +1318,7 @@ int connection_read(ber_socket_t s)
 
                } else if ( rc == 0 ) {
                        void *ssl;
-                       struct berval authid = { 0, NULL };
+                       struct berval authid = BER_BVNULL;
 
                        c->c_needs_tls_accept = 0;
 
index b0d0f0d77673ad0d474753963717f742f102c892..d7257eaffc29940f69a12ac82d958a11b05cd9ae 100644 (file)
@@ -1490,7 +1490,7 @@ slapd_daemon_task(
                        socklen_t len = sizeof(from);
                        long id;
                        slap_ssf_t ssf = 0;
-                       struct berval authid = { 0, NULL };
+                       struct berval authid = BER_BVNULL;
 #ifdef SLAPD_RLOOKUPS
                        char hbuf[NI_MAXHOST];
 #endif
index a1b881bf1a4b52c23c127b0c55cea3bf8ef810f9..67c9f52a78378ce75f212a954f1d80a6c8d9c7ed 100644 (file)
@@ -259,7 +259,7 @@ LDAPDN_rewrite( LDAPDN dn, unsigned flags, void *ctx )
                        slap_mr_normalize_func *normf = NULL;
                        slap_syntax_transform_func *transf = NULL;
                        MatchingRule *mr = NULL;
-                       struct berval           bv = { 0, NULL };
+                       struct berval           bv = BER_BVNULL;
                        int                     do_sort = 0;
 
                        assert( ava );
index 86a2db459dfcb135928fb68383a85d16df8713ae..681c66c5c156407aaf983d9996eb404d9ab20d63 100644 (file)
@@ -437,8 +437,7 @@ test_ava_filter(
                        continue;
                }
 
-               for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ )
-               {
+               for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ ) {
                        int ret;
                        int rc;
                        const char *text;
index cfbbe4b5d96294967c99d6ffc374c94f10b883f0..27da812abd8ea2d786bebbb97f16d486932caa99 100644 (file)
@@ -54,7 +54,7 @@ slap_build_sync_state_ctrl(
        BerElementBuffer berbuf;
        BerElement *ber = (BerElement *)&berbuf;
 
-       struct berval entryuuid_bv      = { 0, NULL };
+       struct berval entryuuid_bv      = BER_BVNULL;
 
        ber_init2( ber, 0, LBER_USE_DER );
        ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
@@ -173,7 +173,7 @@ slap_build_sync_state_ctrl_from_slog(
        BerElementBuffer berbuf;
        BerElement *ber = (BerElement *)&berbuf;
 
-       struct berval entryuuid_bv      = { 0, NULL };
+       struct berval entryuuid_bv      = BER_BVNULL;
 
        ber_init2( ber, NULL, LBER_USE_DER );
        ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
@@ -444,9 +444,9 @@ slap_init_sync_cookie_ctxcsn(
 )
 {
        char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE + 4 ];
-       struct berval octet_str = { 0, NULL };
-       struct berval ctxcsn = { 0, NULL };
-       struct berval ctxcsn_dup = { 0, NULL };
+       struct berval octet_str = BER_BVNULL;
+       struct berval ctxcsn = BER_BVNULL;
+       struct berval ctxcsn_dup = BER_BVNULL;
        struct berval slap_syncCookie;
 
        if ( cookie == NULL )
@@ -523,7 +523,7 @@ slap_build_syncUUID_set(
        int ret;
        Attribute* a;
 
-       struct berval entryuuid_bv      = { 0, NULL };
+       struct berval entryuuid_bv      = BER_BVNULL;
 
        for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
                AttributeDescription *desc = a->a_desc;
index a0cd1380dbff630f260137c6e0e088eac12f9545..528867ba00163986dcce9300541caad4fc7f4a73 100644 (file)
@@ -185,7 +185,7 @@ int main( int argc, char **argv )
        char        *serverName;
        int         serverMode = SLAP_SERVER_MODE;
 
-       struct berval cookie = { 0, NULL };
+       struct berval cookie = BER_BVNULL;
        struct sync_cookie *scp = NULL;
        struct sync_cookie *scp_entry = NULL;
 
index ef7b39638d06defa1b4aca7908e24a34cd5edece..b8a8e61c45d0f2ce62b6fc0fde8746f011e2dd4b 100644 (file)
@@ -206,8 +206,8 @@ test_ava_vrFilter(
                case LDAP_FILTER_APPROX:
                        mr = a->a_desc->ad_type->sat_approx;
                        if( mr != NULL ) break;
+                       /* use EQUALITY matching rule if no APPROX rule */
 
-               /* use EQUALITY matching rule if no APPROX rule */
                case LDAP_FILTER_EQUALITY:
                        mr = a->a_desc->ad_type->sat_equality;
                        break;
@@ -221,10 +221,7 @@ test_ava_vrFilter(
                        mr = NULL;
                }
 
-               if( mr == NULL ) {
-                       continue;
-
-               }
+               if( mr == NULL ) continue;
 
                bv = a->a_nvals;
                for ( j=0; bv->bv_val != NULL; bv++, j++ ) {
index ce2af55cba940a4a88b612efcbaed1a49c27d2d3..029be6ce5b0d97064b4ac22ee9a9fd71e7d944a0 100644 (file)
@@ -48,9 +48,9 @@ get_mra(
        int rc;
        ber_tag_t tag, rtag;
        ber_len_t length;
-       struct berval type = { 0, NULL };
-       struct berval value = { 0, NULL };
-       struct berval rule_text = { 0, NULL };
+       struct berval type = BER_BVNULL;
+       struct berval value = BER_BVNULL;
+       struct berval rule_text = BER_BVNULL;
        MatchingRuleAssertion ma;
 
        memset( &ma, 0, sizeof ma);
index e9c99c895f9bff4d1474fd8c1ab5c0e01583b46b..a55d32d07b1fc661521c2be710b6128542468975 100644 (file)
@@ -40,9 +40,9 @@ static char * referral_dn_muck(
 {
        int rc;
        struct berval bvin;
-       struct berval nrefDN = { 0, NULL };
-       struct berval nbaseDN = { 0, NULL };
-       struct berval ntargetDN = { 0, NULL };
+       struct berval nrefDN = BER_BVNULL;
+       struct berval nbaseDN = BER_BVNULL;
+       struct berval ntargetDN = BER_BVNULL;
 
        if( !baseDN ) {
                /* no base, return target */
index 5d60fc51cb8c30407d209acd5c798428da4603f6..f8ac323a8443fbfe353312c30bb181384500803b 100644 (file)
@@ -300,19 +300,20 @@ replog1(
                                 * in any subset, otherwise drop it.
                                 */
                                if ( ocs && ml->sml_desc == slap_schema.si_ad_objectClass
-                                       && ml->sml_bvalues ) {
+                                       && ml->sml_values )
+                               {
                                        int i, first = 1;
 
                                        if ( ocs == -1 ) ocs = 0;
 
-                                       for ( i=0; ml->sml_bvalues[i].bv_val; i++ ) {
+                                       for ( i=0; ml->sml_values[i].bv_val; i++ ) {
                                                int match = 0;
                                                for ( an = ri->ri_attrs; an->an_name.bv_val; an++ ) {
                                                        if ( an->an_oc ) {
                                                                ocs = 1;
                                                                match |= an->an_oc_exclude;
-                                                               if ( ml->sml_bvalues[i].bv_len == an->an_name.bv_len
-                                                                       && !strcasecmp(ml->sml_bvalues[i].bv_val,
+                                                               if ( ml->sml_values[i].bv_len == an->an_name.bv_len
+                                                                       && !strcasecmp(ml->sml_values[i].bv_val,
                                                                                an->an_name.bv_val ) ) {
                                                                        match = !an->an_oc_exclude;
                                                                        break;
@@ -357,8 +358,8 @@ replog1(
                                dohdr = 0;
                        }
                        fprintf( fp, "%s: %s\n", did, type );
-                       if ( ml->sml_bvalues ) {
-                               print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_bvalues );
+                       if ( ml->sml_values ) {
+                               print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_values );
                        }
                        fprintf( fp, "-\n" );
                }
index ccabe6dc17bb9fc394e1b0f6ab966a0eea319ef0..2ec71868dd197bb652ea650ff4eeddd8b4663376 100644 (file)
@@ -810,12 +810,12 @@ int mods_structural_class(
                return LDAP_OBJECT_CLASS_VIOLATION;
        }
 
-       if( ocmod->sml_bvalues == NULL || ocmod->sml_bvalues[0].bv_val == NULL ) {
+       if( ocmod->sml_values == NULL || ocmod->sml_values[0].bv_val == NULL ) {
                *text = "objectClass attribute has no values";
                return LDAP_OBJECT_CLASS_VIOLATION;
        }
 
-       return structural_class( ocmod->sml_bvalues, sc, NULL,
+       return structural_class( ocmod->sml_values, sc, NULL,
                text, textbuf, textlen );
 }
 
index e6169e44f5647eb95d2b0d1483d1b8f3089bfc3c..499935beed43b870e1e0d94b28d0b5824958dd32 100644 (file)
@@ -804,7 +804,7 @@ nameUIDPretty(
        } else {
                int rc;
                struct berval dnval = *val;
-               struct berval uidval = { 0, NULL };
+               struct berval uidval = BER_BVNULL;
 
                if( val->bv_val[val->bv_len-1] == 'B'
                        && val->bv_val[val->bv_len-2] == '\'' )
@@ -875,7 +875,7 @@ uniqueMemberNormalize(
 
        ber_dupbv( &out, val );
        if( out.bv_len != 0 ) {
-               struct berval uid = { 0, NULL };
+               struct berval uid = BER_BVNULL;
 
                if( out.bv_val[out.bv_len-1] == 'B'
                        && out.bv_val[out.bv_len-2] == '\'' )
@@ -935,10 +935,10 @@ uniqueMemberMatch(
 {
        int match;
        struct berval *asserted = (struct berval *) assertedValue;
-       struct berval assertedDN = { 0, NULL };
-       struct berval assertedUID = { 0, NULL };
-       struct berval valueDN = { 0, NULL };
-       struct berval valueUID = { 0, NULL };
+       struct berval assertedDN = BER_BVNULL;
+       struct berval assertedUID = BER_BVNULL;
+       struct berval valueDN = BER_BVNULL;
+       struct berval valueUID = BER_BVNULL;
 
        if( asserted->bv_len != 0 ) {
                assertedDN = *asserted;
@@ -1372,7 +1372,7 @@ approxIndexer(
        BerVarray keys=NULL;
 
        for( j=0; values[j].bv_val != NULL; j++ ) {
-               struct berval val = { 0, NULL };
+               struct berval val = BER_BVNULL;
                /* Yes, this is necessary */
                UTF8bvnormalize( &values[j], &val, LDAP_UTF8_APPROX, NULL );
                assert( val.bv_val != NULL );
@@ -2210,7 +2210,7 @@ certificateExactNormalize(
        unsigned char *p;
        char *serial = NULL;
        ber_len_t seriallen;
-       struct berval issuer_dn = { 0, NULL };
+       struct berval issuer_dn = BER_BVNULL;
        X509_NAME *name = NULL;
        ASN1_INTEGER *sn = NULL;
        X509 *xcert = NULL;
index 6fff9791d71b007933a423545679d41bb83a6149..b920643a19b9f13a48755313aa19c224feb02415 100644 (file)
@@ -49,7 +49,7 @@ do_search(
     Operation  *op,    /* info about the op to which we're responding */
     SlapReply  *rs     /* all the response data we'll send */
 ) {
-       struct berval base = { 0, NULL };
+       struct berval base = BER_BVNULL;
        ber_len_t       siz, off, i;
        int                     manageDSAit;
        int                     be_manageDSAit;
index 0d164f2b8dd6c56ca5ab7fe11739d6a752fb50c2..54421f5fba8fb877586c8c3ce3fb273735321f8a 100644 (file)
@@ -66,8 +66,8 @@ slapadd( int argc, char **argv )
        const char *progname = "slapadd";
 
        struct berval csn;
-       struct berval maxcsn = { 0, NULL };
-       struct berval ldifcsn = { 0, NULL };
+       struct berval maxcsn = BER_BVNULL;
+       struct berval ldifcsn = BER_BVNULL;
        int match;
        int     provider_subentry = 0;
        struct subentryinfo *sei;
@@ -75,7 +75,7 @@ slapadd( int argc, char **argv )
        Attribute *attr;
        Entry *ctxcsn_e;
        ID      ctxcsn_id;
-       struct berval   ctxcsn_ndn = { 0, NULL };
+       struct berval   ctxcsn_ndn = BER_BVNULL;
        int ret;
        struct berval bvtext;
        int i;
index 4944272d911a73c9924d788d1c29a7e1848a16d9..a04be91af650278b5f438c420c7086b36abf9e00 100644 (file)
@@ -94,7 +94,7 @@ slap_tool_init(
 {
        char *options;
        char *conffile = SLAPD_DEFAULT_CONFIGFILE;
-       struct berval base = { 0, NULL };
+       struct berval base = BER_BVNULL;
        char *subtree = NULL;
        char *ldiffile  = NULL;
        int rc, i, dbnum;
index bf8077c7c68bcec966285e3ce83c93eb772b0fbb..893803def992d74cba5d292812aa852b12c9c1db 100644 (file)
@@ -41,8 +41,7 @@
 int
 value_add( 
     BerVarray *vals,
-    BerVarray addvals
-)
+    BerVarray addvals )
 {
        int     n, nn;
        BerVarray v2;
@@ -96,8 +95,7 @@ value_add(
 int
 value_add_one( 
     BerVarray *vals,
-    struct berval *addval
-)
+    struct berval *addval )
 {
        int     n;
        BerVarray v2;
@@ -217,8 +215,8 @@ value_match(
        const char ** text )
 {
        int rc;
-       struct berval nv1 = { 0, NULL };
-       struct berval nv2 = { 0, NULL };
+       struct berval nv1 = BER_BVNULL;
+       struct berval nv2 = BER_BVNULL;
 
        assert( mr != NULL );
 
@@ -246,7 +244,7 @@ int value_find_ex(
 {
        int     i;
        int rc;
-       struct berval nval = { 0, NULL };
+       struct berval nval = BER_BVNULL;
        MatchingRule *mr = ad->ad_type->sat_equality;
 
        if( mr == NULL || !mr->smr_match ) {