From 44725e73034f8a077ca73f1ad359f913d37a89ac Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 7 Apr 2004 04:11:43 +0000 Subject: [PATCH] use BER_BVNULL --- servers/slapd/acl.c | 6 ++--- servers/slapd/aclparse.c | 2 +- servers/slapd/add.c | 2 +- servers/slapd/back-bdb/ctxcsn.c | 2 +- servers/slapd/back-bdb/init.c | 2 +- servers/slapd/back-bdb/search.c | 6 ++--- servers/slapd/back-dnssrv/search.c | 2 +- servers/slapd/back-ldap/add.c | 2 +- servers/slapd/back-ldap/bind.c | 2 +- servers/slapd/back-ldap/compare.c | 4 ++-- servers/slapd/back-ldap/delete.c | 2 +- servers/slapd/back-ldap/extended.c | 2 +- servers/slapd/back-ldap/modify.c | 2 +- servers/slapd/back-ldap/modrdn.c | 2 +- servers/slapd/back-ldap/search.c | 8 +++---- servers/slapd/back-ldbm/modrdn.c | 4 ++-- servers/slapd/back-ldbm/search.c | 4 ++-- servers/slapd/back-meta/add.c | 2 +- servers/slapd/back-meta/bind.c | 2 +- servers/slapd/back-meta/compare.c | 4 ++-- servers/slapd/back-meta/delete.c | 2 +- servers/slapd/back-meta/group.c | 4 ++-- servers/slapd/back-meta/modify.c | 2 +- servers/slapd/back-meta/modrdn.c | 4 ++-- servers/slapd/back-meta/search.c | 8 +++---- servers/slapd/back-monitor/log.c | 32 +++++++++++++------------- servers/slapd/back-monitor/operation.c | 2 +- servers/slapd/back-passwd/search.c | 2 +- servers/slapd/bind.c | 4 ++-- servers/slapd/compare.c | 8 +++---- servers/slapd/config.c | 8 +++---- servers/slapd/connection.c | 2 +- servers/slapd/controls.c | 8 +++---- servers/slapd/daemon.c | 2 +- servers/slapd/delete.c | 12 +++++----- servers/slapd/dn.c | 2 +- servers/slapd/ldapsync.c | 12 +++++----- servers/slapd/main.c | 2 +- servers/slapd/modify.c | 2 +- servers/slapd/modrdn.c | 20 ++++++++-------- servers/slapd/mra.c | 6 ++--- servers/slapd/overlays/pcache.c | 2 +- servers/slapd/overlays/ppolicy.c | 2 +- servers/slapd/overlays/rwm.c | 8 +++---- servers/slapd/referral.c | 6 ++--- servers/slapd/sasl.c | 8 +++---- servers/slapd/saslauthz.c | 8 +++---- servers/slapd/schema_init.c | 16 ++++++------- servers/slapd/search.c | 2 +- servers/slapd/slapadd.c | 6 ++--- servers/slapd/slapcommon.c | 2 +- servers/slapd/slapi/slapi_ops.c | 14 +++++------ servers/slapd/slapi/slapi_utils.c | 2 +- servers/slapd/syncrepl.c | 30 ++++++++++++------------ servers/slapd/value.c | 6 ++--- 55 files changed, 159 insertions(+), 159 deletions(-) diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index e5db4a6cfd..754e9539bf 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -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 ) { @@ -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; diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 61dda94b37..b21fab1ff6 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -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 ); diff --git a/servers/slapd/add.c b/servers/slapd/add.c index ffa94168b6..ebb06d69af 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -46,7 +46,7 @@ do_add( Operation *op, SlapReply *rs ) { BerElement *ber = op->o_ber; char *last; - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; ber_len_t len; ber_tag_t tag; Entry *e; diff --git a/servers/slapd/back-bdb/ctxcsn.c b/servers/slapd/back-bdb/ctxcsn.c index 104ed0d86c..d95989caf0 100644 --- a/servers/slapd/back-bdb/ctxcsn.c +++ b/servers/slapd/back-bdb/ctxcsn.c @@ -39,7 +39,7 @@ bdb_csn_commit( ) { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; - struct berval ctxcsn_ndn = { 0, NULL }; + struct berval ctxcsn_ndn = BER_BVNULL; EntryInfo *ctxcsn_ei = NULL; DB_LOCK ctxcsn_lock; struct berval max_committed_csn; diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index cd9d9a7c26..86a95559d0 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -36,7 +36,7 @@ static const struct bdbi_database { { NULL, NULL, 0, 0 } }; -struct berval bdb_uuid = { 0, NULL }; +struct berval bdb_uuid = BER_BVNULL; typedef void * db_malloc(size_t); typedef void * db_realloc(void *, size_t); diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 97da998b23..34c4abe7e0 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -376,7 +376,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, Entry *e = NULL, base; Entry *matched = NULL; EntryInfo *ei; - struct berval realbase = { 0, NULL }; + struct berval realbase = BER_BVNULL; int manageDSAit; int tentries = 0; ID lastid = NOID; @@ -558,7 +558,7 @@ dn2entry_retry: } if ( e == NULL ) { - struct berval matched_dn = { 0, NULL }; + struct berval matched_dn = BER_BVNULL; if ( matched != NULL ) { BerVarray erefs; @@ -1674,7 +1674,7 @@ send_pagerequest_response( LDAPControl ctrl, *ctrls[2]; BerElementBuffer berbuf; BerElement *ber = (BerElement *)&berbuf; - struct berval cookie = { 0, NULL }; + struct berval cookie = BER_BVNULL; PagedResultsCookie respcookie; #ifdef NEW_LOGGING diff --git a/servers/slapd/back-dnssrv/search.c b/servers/slapd/back-dnssrv/search.c index 09954e13b3..cac168ad1a 100644 --- a/servers/slapd/back-dnssrv/search.c +++ b/servers/slapd/back-dnssrv/search.c @@ -41,7 +41,7 @@ dnssrv_back_search( char *hostlist = NULL; char **hosts = NULL; char *refdn; - struct berval nrefdn = { 0, NULL }; + struct berval nrefdn = BER_BVNULL; BerVarray urls = NULL; int manageDSAit; diff --git a/servers/slapd/back-ldap/add.c b/servers/slapd/back-ldap/add.c index 53e29906e6..72c40f0b51 100644 --- a/servers/slapd/back-ldap/add.c +++ b/servers/slapd/back-ldap/add.c @@ -42,7 +42,7 @@ ldap_back_add( Attribute *a; LDAPMod **attrs; struct berval mapped; - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; ber_int_t msgid; dncookie dc; int isupdate; diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 26aa3fe5b5..41580063e6 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -45,7 +45,7 @@ ldap_back_bind( struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapconn *lc; - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; int rc = 0; ber_int_t msgid; dncookie dc; diff --git a/servers/slapd/back-ldap/compare.c b/servers/slapd/back-ldap/compare.c index 8af11742f5..f8d04d71ce 100644 --- a/servers/slapd/back-ldap/compare.c +++ b/servers/slapd/back-ldap/compare.c @@ -38,8 +38,8 @@ ldap_back_compare( { struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapconn *lc; - struct berval mapped_at = { 0, NULL }, mapped_val = { 0, NULL }; - struct berval mdn = { 0, NULL }; + struct berval mapped_at = BER_BVNULL, mapped_val = BER_BVNULL; + struct berval mdn = BER_BVNULL; ber_int_t msgid; int freeval = 0; dncookie dc; diff --git a/servers/slapd/back-ldap/delete.c b/servers/slapd/back-ldap/delete.c index 91a7b53f2c..f7837f45f4 100644 --- a/servers/slapd/back-ldap/delete.c +++ b/servers/slapd/back-ldap/delete.c @@ -45,7 +45,7 @@ ldap_back_delete( int rc = LDAP_SUCCESS; #endif /* LDAP_BACK_PROXY_AUTHZ */ - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; lc = ldap_back_getconn( op, rs ); diff --git a/servers/slapd/back-ldap/extended.c b/servers/slapd/back-ldap/extended.c index 9e0641209f..6f35c898a2 100644 --- a/servers/slapd/back-ldap/extended.c +++ b/servers/slapd/back-ldap/extended.c @@ -96,7 +96,7 @@ ldap_back_exop_passwd( struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapconn *lc; req_pwdexop_s *qpw = &op->oq_pwdexop; - struct berval mdn = { 0, NULL }, newpw; + struct berval mdn = BER_BVNULL, newpw; LDAPMessage *res; ber_int_t msgid; int rc, isproxy; diff --git a/servers/slapd/back-ldap/modify.c b/servers/slapd/back-ldap/modify.c index b40664261f..6f1ccd169c 100644 --- a/servers/slapd/back-ldap/modify.c +++ b/servers/slapd/back-ldap/modify.c @@ -43,7 +43,7 @@ ldap_back_modify( Modifications *ml; int i, j, rc; struct berval mapped; - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; ber_int_t msgid; dncookie dc; int isupdate; diff --git a/servers/slapd/back-ldap/modrdn.c b/servers/slapd/back-ldap/modrdn.c index a479131c86..5a75d9d4b4 100644 --- a/servers/slapd/back-ldap/modrdn.c +++ b/servers/slapd/back-ldap/modrdn.c @@ -45,7 +45,7 @@ ldap_back_modrdn( int rc = LDAP_SUCCESS; #endif /* LDAP_BACK_PROXY_AUTHZ */ - struct berval mdn = { 0, NULL }, mnewSuperior = { 0, NULL }; + struct berval mdn = BER_BVNULL, mnewSuperior = BER_BVNULL; lc = ldap_back_getconn( op, rs ); if ( !lc || !ldap_back_dobind(lc, op, rs) ) { diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index b0d137cb0e..a652863997 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -42,7 +42,7 @@ ldap_build_entry( Operation *op, LDAPMessage *e, Entry *ent, #define LDAP_BUILD_ENTRY_PRIVATE 0x01 #define LDAP_BUILD_ENTRY_NORMALIZE 0x02 -static struct berval dummy = { 0, NULL }; +static struct berval dummy = BER_BVNULL; int ldap_back_search( @@ -54,10 +54,10 @@ ldap_back_search( struct timeval tv; LDAPMessage *res, *e; int rc = 0, msgid; - struct berval match = { 0, NULL }; + struct berval match = BER_BVNULL; char **mapped_attrs = NULL; struct berval mbase; - struct berval mfilter = { 0, NULL }; + struct berval mfilter = BER_BVNULL; int dontfreetext = 0; dncookie dc; #ifdef LDAP_BACK_PROXY_AUTHZ @@ -532,7 +532,7 @@ ldap_back_entry_get( struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapconn *lc; int rc = 1, is_oc; - struct berval mapped = { 0, NULL }, bdn, mdn; + struct berval mapped = BER_BVNULL, bdn, mdn; LDAPMessage *result = NULL, *e = NULL; char *gattr[3]; char *filter = NULL; diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index 9a404409ca..d0a7c791c4 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -42,8 +42,8 @@ ldbm_back_modrdn( AttributeDescription *entry = slap_schema.si_ad_entry; struct ldbminfo *li = (struct ldbminfo *) op->o_bd->be_private; struct berval p_dn, p_ndn; - struct berval new_dn = { 0, NULL}, new_ndn = { 0, NULL }; - struct berval old_ndn = { 0, NULL }; + struct berval new_dn = BER_BVNULL, new_ndn = BER_BVNULL; + struct berval old_ndn = BER_BVNULL; Entry *e, *p = NULL; Entry *matched; /* LDAP v2 supporting correct attribute handling. */ diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index acebe63641..4db79f7740 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -46,7 +46,7 @@ ldbm_back_search( ID id, cursor; Entry *e; Entry *matched = NULL; - struct berval realbase = { 0, NULL }; + struct berval realbase = BER_BVNULL; int manageDSAit = get_manageDSAit( op ); #ifdef NEW_LOGGING @@ -86,7 +86,7 @@ ldbm_back_search( } if ( e == NULL ) { - struct berval matched_dn = { 0, NULL }; + struct berval matched_dn = BER_BVNULL; if ( matched != NULL ) { BerVarray erefs; diff --git a/servers/slapd/back-meta/add.c b/servers/slapd/back-meta/add.c index a65a380812..02ef16770d 100644 --- a/servers/slapd/back-meta/add.c +++ b/servers/slapd/back-meta/add.c @@ -40,7 +40,7 @@ meta_back_add( Operation *op, SlapReply *rs ) int i, candidate = -1; Attribute *a; LDAPMod **attrs; - struct berval mdn = { 0, NULL }, mapped; + struct berval mdn = BER_BVNULL, mapped; dncookie dc; #ifdef NEW_LOGGING diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index a62977520e..d828ff0a62 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -191,7 +191,7 @@ meta_back_do_single_bind( ) { struct metainfo *li = ( struct metainfo * )op->o_bd->be_private; - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; ber_int_t msgid; dncookie dc; struct metasingleconn *lsc = &lc->conns[ candidate ]; diff --git a/servers/slapd/back-meta/compare.c b/servers/slapd/back-meta/compare.c index da20763aab..f5468c2449 100644 --- a/servers/slapd/back-meta/compare.c +++ b/servers/slapd/back-meta/compare.c @@ -38,7 +38,7 @@ meta_back_compare( Operation *op, SlapReply *rs ) struct metaconn *lc; struct metasingleconn *lsc; char *match = NULL, *err = NULL; - struct berval mmatch = { 0, NULL }; + struct berval mmatch = BER_BVNULL; int candidates = 0, last = 0, i, count = 0, rc; int cres = LDAP_SUCCESS, rres = LDAP_SUCCESS; int *msgid; @@ -70,7 +70,7 @@ meta_back_compare( Operation *op, SlapReply *rs ) dc.ctx = "compareDN"; for ( i = 0, lsc = lc->conns; !META_LAST(lsc); ++i, ++lsc ) { - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; struct berval mapped_attr = op->oq_compare.rs_ava->aa_desc->ad_cname; struct berval mapped_value = op->oq_compare.rs_ava->aa_value; diff --git a/servers/slapd/back-meta/delete.c b/servers/slapd/back-meta/delete.c index c3c8ea8f5f..18973f0c28 100644 --- a/servers/slapd/back-meta/delete.c +++ b/servers/slapd/back-meta/delete.c @@ -37,7 +37,7 @@ meta_back_delete( Operation *op, SlapReply *rs ) struct metainfo *li = ( struct metainfo * )op->o_bd->be_private; struct metaconn *lc; int candidate = -1; - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; dncookie dc; lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE, diff --git a/servers/slapd/back-meta/group.c b/servers/slapd/back-meta/group.c index a055732886..7c4f357814 100644 --- a/servers/slapd/back-meta/group.c +++ b/servers/slapd/back-meta/group.c @@ -56,9 +56,9 @@ meta_back_group( char *gattr[ 2 ]; char *filter = NULL, *ptr; LDAP *ld = NULL; - struct berval mop_ndn = { 0, NULL }, mgr_ndn = { 0, NULL }; + struct berval mop_ndn = BER_BVNULL, mgr_ndn = BER_BVNULL; - struct berval group_oc_name = { 0, NULL }; + struct berval group_oc_name = BER_BVNULL; struct berval group_at_name = group_at->ad_cname; if ( group_oc->soc_names && group_oc->soc_names[ 0 ] ) { diff --git a/servers/slapd/back-meta/modify.c b/servers/slapd/back-meta/modify.c index c44a1f214c..62ae54b1e5 100644 --- a/servers/slapd/back-meta/modify.c +++ b/servers/slapd/back-meta/modify.c @@ -41,7 +41,7 @@ meta_back_modify( Operation *op, SlapReply *rs ) LDAPMod *mods = NULL; Modifications *ml; int candidate = -1, i; - struct berval mdn = { 0, NULL }; + struct berval mdn = BER_BVNULL; struct berval mapped; dncookie dc; diff --git a/servers/slapd/back-meta/modrdn.c b/servers/slapd/back-meta/modrdn.c index 8d2164c6c5..22cdc7c4f5 100644 --- a/servers/slapd/back-meta/modrdn.c +++ b/servers/slapd/back-meta/modrdn.c @@ -50,8 +50,8 @@ meta_back_modrdn( Operation *op, SlapReply *rs ) struct metaconn *lc; int rc = 0; int candidate = -1; - struct berval mdn = { 0, NULL }, - mnewSuperior = { 0, NULL }; + struct berval mdn = BER_BVNULL, + mnewSuperior = BER_BVNULL; dncookie dc; lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE, diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index ceea4402b4..2e239e3383 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -61,7 +61,7 @@ meta_back_search( Operation *op, SlapReply *rs ) LDAPMessage *res = NULL, *e; int rc = 0, *msgid, sres = LDAP_SUCCESS; char *err = NULL; - struct berval match = { 0, NULL }, mmatch = { 0, NULL }; + struct berval match = BER_BVNULL, mmatch = BER_BVNULL; BerVarray v2refs = NULL; int i, last = 0, candidates = 0, initial_candidates = 0, @@ -110,8 +110,8 @@ meta_back_search( Operation *op, SlapReply *rs ) struct berval realbase = op->o_req_dn; int realscope = op->ors_scope; ber_len_t suffixlen = 0; - struct berval mbase = { 0, NULL }; - struct berval mfilter = { 0, NULL }; + struct berval mbase = BER_BVNULL; + struct berval mfilter = BER_BVNULL; char **mapped_attrs = NULL; if ( lsc->candidate != META_CANDIDATE ) { @@ -558,7 +558,7 @@ meta_send_entry( Entry ent = {0}; BerElement ber = *e->lm_ber; Attribute *attr, **attrp; - struct berval dummy = { 0, NULL }; + struct berval dummy = BER_BVNULL; struct berval *bv, bdn; const char *text; dncookie dc; diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index 7fa5f548b0..1510cbfc72 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -41,21 +41,21 @@ static struct { struct berval s; struct berval n; } int_2_level[] = { - { LDAP_DEBUG_TRACE, BER_BVC("Trace"), { 0, NULL } }, - { LDAP_DEBUG_PACKETS, BER_BVC("Packets"), { 0, NULL } }, - { LDAP_DEBUG_ARGS, BER_BVC("Args"), { 0, NULL } }, - { LDAP_DEBUG_CONNS, BER_BVC("Conns"), { 0, NULL } }, - { LDAP_DEBUG_BER, BER_BVC("BER"), { 0, NULL } }, - { LDAP_DEBUG_FILTER, BER_BVC("Filter"), { 0, NULL } }, - { LDAP_DEBUG_CONFIG, BER_BVC("Config"), { 0, NULL } }, /* useless */ - { LDAP_DEBUG_ACL, BER_BVC("ACL"), { 0, NULL } }, - { LDAP_DEBUG_STATS, BER_BVC("Stats"), { 0, NULL } }, - { LDAP_DEBUG_STATS2, BER_BVC("Stats2"), { 0, NULL } }, - { LDAP_DEBUG_SHELL, BER_BVC("Shell"), { 0, NULL } }, - { LDAP_DEBUG_PARSE, BER_BVC("Parse"), { 0, NULL } }, - { LDAP_DEBUG_CACHE, BER_BVC("Cache"), { 0, NULL } }, - { LDAP_DEBUG_INDEX, BER_BVC("Index"), { 0, NULL } }, - { 0, { 0, NULL }, { 0, NULL } } + { LDAP_DEBUG_TRACE, BER_BVC("Trace"), BER_BVNULL }, + { LDAP_DEBUG_PACKETS, BER_BVC("Packets"), BER_BVNULL }, + { LDAP_DEBUG_ARGS, BER_BVC("Args"), BER_BVNULL }, + { LDAP_DEBUG_CONNS, BER_BVC("Conns"), BER_BVNULL }, + { LDAP_DEBUG_BER, BER_BVC("BER"), BER_BVNULL }, + { LDAP_DEBUG_FILTER, BER_BVC("Filter"), BER_BVNULL }, + { LDAP_DEBUG_CONFIG, BER_BVC("Config"), BER_BVNULL }, /* useless */ + { LDAP_DEBUG_ACL, BER_BVC("ACL"), BER_BVNULL }, + { LDAP_DEBUG_STATS, BER_BVC("Stats"), BER_BVNULL }, + { LDAP_DEBUG_STATS2, BER_BVC("Stats2"), BER_BVNULL }, + { LDAP_DEBUG_SHELL, BER_BVC("Shell"), BER_BVNULL }, + { LDAP_DEBUG_PARSE, BER_BVC("Parse"), BER_BVNULL }, + { LDAP_DEBUG_CACHE, BER_BVC("Cache"), BER_BVNULL }, + { LDAP_DEBUG_INDEX, BER_BVC("Index"), BER_BVNULL }, + { 0, BER_BVNULL, BER_BVNULL } }; static int loglevel2int( struct berval *l ); @@ -79,7 +79,7 @@ monitor_subsys_log_init( struct berval desc[] = { BER_BVC("This entry allows to set the log level runtime."), BER_BVC("Set the attribute 'managedInfo' to the desired log levels."), - { 0, NULL } + BER_BVNULL }; ldap_pvt_thread_mutex_init( &monitor_log_mutex ); diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index 0c23b779eb..8d9982bd89 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -40,7 +40,7 @@ static struct berval BER_BVC( "Search" ), BER_BVC( "Abandon" ), BER_BVC( "Extended" ), - { 0, NULL } + BER_BVNULL }; int diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 3e3560e569..4f77968719 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -65,7 +65,7 @@ passwd_back_search( time_t stoptime; LDAPRDN rdn = NULL; - struct berval parent = { 0, NULL }; + struct berval parent = BER_BVNULL; AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass; diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index c360ea3043..1423aca172 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -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; diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 8414ad20f2..9c483a7a67 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -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; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 3f9db3e69f..d157227a81 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -73,11 +73,11 @@ char *ldap_srvtab = ""; char **default_passwd_hash = NULL; int cargc = 0, cargv_size = 0; char **cargv; -struct berval default_search_base = { 0, NULL }; -struct berval default_search_nbase = { 0, NULL }; +struct berval default_search_base = BER_BVNULL; +struct berval default_search_nbase = BER_BVNULL; unsigned num_subordinates = 0; -struct berval global_schemadn = { 0, NULL }; -struct berval global_schemandn = { 0, NULL }; +struct berval global_schemadn = BER_BVNULL; +struct berval global_schemandn = BER_BVNULL; ber_len_t sockbuf_max_incoming = SLAP_SB_MAX_INCOMING_DEFAULT; ber_len_t sockbuf_max_incoming_auth= SLAP_SB_MAX_INCOMING_AUTH; diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index b829d2c8ca..ffcb0312c5 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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; diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 2651c1e405..ab5ee35546 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -714,7 +714,7 @@ static int parseProxyAuthz ( LDAPControl *ctrl ) { int rc; - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; if ( op->o_proxy_authz != SLAP_NO_CONTROL ) { rs->sr_text = "proxy authorization control specified multiple times"; @@ -840,7 +840,7 @@ static int parsePagedResults ( ber_tag_t tag; ber_int_t size; BerElement *ber; - struct berval cookie = { 0, NULL }; + struct berval cookie = BER_BVNULL; if ( op->o_pagedresults != SLAP_NO_CONTROL ) { rs->sr_text = "paged results control specified multiple times"; @@ -919,7 +919,7 @@ static int parseAssert ( LDAPControl *ctrl ) { BerElement *ber; - struct berval fstr = { 0, NULL }; + struct berval fstr = BER_BVNULL; const char *err_msg = ""; if ( op->o_assert != SLAP_NO_CONTROL ) { @@ -1094,7 +1094,7 @@ int parseValuesReturnFilter ( LDAPControl *ctrl ) { BerElement *ber; - struct berval fstr = { 0, NULL }; + struct berval fstr = BER_BVNULL; const char *err_msg = ""; if ( op->o_valuesreturnfilter != SLAP_NO_CONTROL ) { diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index b0d0f0d776..d7257eaffc 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -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 diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 4e701eaa31..eded998295 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -45,12 +45,12 @@ do_delete( SlapReply *rs ) { - struct berval dn = { 0, NULL }; - struct berval pdn = { 0, NULL }; - struct berval org_req_dn = { 0, NULL }; - struct berval org_req_ndn = { 0, NULL }; - struct berval org_dn = { 0, NULL }; - struct berval org_ndn = { 0, NULL }; + struct berval dn = BER_BVNULL; + struct berval pdn = BER_BVNULL; + struct berval org_req_dn = BER_BVNULL; + struct berval org_req_ndn = BER_BVNULL; + struct berval org_dn = BER_BVNULL; + struct berval org_ndn = BER_BVNULL; int org_managedsait; int manageDSAit; diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index a1b881bf1a..67c9f52a78 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -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 ); diff --git a/servers/slapd/ldapsync.c b/servers/slapd/ldapsync.c index cfbbe4b5d9..27da812abd 100644 --- a/servers/slapd/ldapsync.c +++ b/servers/slapd/ldapsync.c @@ -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; diff --git a/servers/slapd/main.c b/servers/slapd/main.c index a0cd1380db..528867ba00 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -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; diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index ea498a0f06..0f81ef1a39 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -44,7 +44,7 @@ do_modify( Operation *op, SlapReply *rs ) { - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; char *last; ber_tag_t tag; ber_len_t len; diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index ae45b32a7c..205ea71166 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -50,24 +50,24 @@ do_modrdn( SlapReply *rs ) { - struct berval dn = { 0, NULL }; - struct berval newrdn = { 0, NULL }; - struct berval newSuperior = { 0, NULL }; + struct berval dn = BER_BVNULL; + struct berval newrdn = BER_BVNULL; + struct berval newSuperior = BER_BVNULL; ber_int_t deloldrdn; - struct berval pnewSuperior = { 0, NULL }; + struct berval pnewSuperior = BER_BVNULL; - struct berval nnewSuperior = { 0, NULL }; + struct berval nnewSuperior = BER_BVNULL; Backend *newSuperior_be = NULL; ber_len_t length; int manageDSAit; - struct berval pdn = { 0, NULL }; - struct berval org_req_dn = { 0, NULL }; - struct berval org_req_ndn = { 0, NULL }; - struct berval org_dn = { 0, NULL }; - struct berval org_ndn = { 0, NULL }; + struct berval pdn = BER_BVNULL; + struct berval org_req_dn = BER_BVNULL; + struct berval org_req_ndn = BER_BVNULL; + struct berval org_dn = BER_BVNULL; + struct berval org_ndn = BER_BVNULL; int org_managedsait; #ifdef NEW_LOGGING diff --git a/servers/slapd/mra.c b/servers/slapd/mra.c index ce2af55cba..029be6ce5b 100644 --- a/servers/slapd/mra.c +++ b/servers/slapd/mra.c @@ -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); diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 8c74437d47..3374f37f07 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -205,7 +205,7 @@ static int base_scope_compare( int scope_stored, int scope_incoming ) { - struct berval pdn_incoming = { 0, NULL }; + struct berval pdn_incoming = BER_BVNULL; if (scope_stored < scope_incoming) return 0; diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index d9cee2cf11..084803987b 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -1246,7 +1246,7 @@ ppolicy_modify( Operation *op, SlapReply *rs ) pw_hist *tl = NULL, *p; int zapReset, send_ctrl = 0; Entry *e; - struct berval newpw = { 0, NULL }, oldpw = { 0, NULL }, + struct berval newpw = BER_BVNULL, oldpw = BER_BVNULL, *bv, cr[2]; LDAPPasswordPolicyError pErr = PP_noError; diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 56d6294ddc..20f40dab49 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -31,7 +31,7 @@ rwm_op_dn_massage( Operation *op, SlapReply *rs, void *cookie ) struct ldaprwmap *rwmap = (struct ldaprwmap *)on->on_bi.bi_private; - struct berval dn, ndn, mdn = { 0, NULL }; + struct berval dn, ndn, mdn = BER_BVNULL; int rc = 0; dncookie dc; @@ -200,8 +200,8 @@ rwm_compare( Operation *op, SlapReply *rs ) (struct ldaprwmap *)on->on_bi.bi_private; int rc; - struct berval mapped_at = { 0, NULL }, - mapped_vals[2] = { { 0, NULL }, { 0, NULL } }; + struct berval mapped_at = BER_BVNULL, + mapped_vals[2] = { BER_BVNULL, BER_BVNULL }; #ifdef ENABLE_REWRITE rc = rwm_op_dn_massage( op, rs, "compareDn" ); @@ -422,7 +422,7 @@ rwm_send_entry( Operation *op, SlapReply *rs ) (struct ldaprwmap *)on->on_bi.bi_private; Entry *e = NULL; - struct berval dn = { 0, NULL }, ndn = { 0, NULL }; + struct berval dn = BER_BVNULL, ndn = BER_BVNULL; dncookie dc; int rc = SLAP_CB_CONTINUE; diff --git a/servers/slapd/referral.c b/servers/slapd/referral.c index e9c99c895f..a55d32d07b 100644 --- a/servers/slapd/referral.c +++ b/servers/slapd/referral.c @@ -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 */ diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index cffc17423c..2c2bdf7aa3 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -1615,9 +1615,9 @@ char* slap_sasl_secprops( const char *in ) int slap_sasl_setpass( Operation *op, SlapReply *rs ) { - struct berval id = { 0, NULL }; /* needs to come from connection */ - struct berval new = { 0, NULL }; - struct berval old = { 0, NULL }; + struct berval id = BER_BVNULL; /* needs to come from connection */ + struct berval new = BER_BVNULL; + struct berval old = BER_BVNULL; assert( ber_bvcmp( &slap_EXOP_MODIFY_PASSWD, &op->ore_reqoid ) == 0 ); @@ -1783,7 +1783,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, char *id, int len, /* Username strings */ if( is_dn == SET_U ) { char *p; - struct berval realm = { 0, NULL }, c1 = *dn; + struct berval realm = BER_BVNULL, c1 = *dn; len = dn->bv_len + sizeof("uid=")-1 + sizeof(",cn=auth")-1; diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 48ab0e9004..edd348657e 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -276,9 +276,9 @@ is_dn: bv.bv_len = uri->bv_len - (bv.bv_val - uri->bv_val); Connection c = *op->o_conn; char buf[ SLAP_LDAPDN_MAXLEN ]; struct berval id, - user = { 0, NULL }, - realm = { 0, NULL }, - mech = { 0, NULL }; + user = BER_BVNULL, + realm = BER_BVNULL, + mech = BER_BVNULL; if ( sizeof( buf ) <= uri->bv_len ) { return LDAP_INVALID_SYNTAX; @@ -849,7 +849,7 @@ void slap_sasl2dn( Operation *opx, slap_callback cb = { NULL, sasl_sc_sasl2dn, NULL, NULL }; Operation op = {0}; SlapReply rs = {REP_RESULT}; - struct berval regout = { 0, NULL }; + struct berval regout = BER_BVNULL; #ifdef NEW_LOGGING LDAP_LOG( TRANSPORT, ENTRY, diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index e6169e44f5..499935beed 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -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; diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 91dcdb2b2f..52e7d5a3da 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -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; diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index 0d164f2b8d..54421f5fba 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -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; diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 4944272d91..a04be91af6 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -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; diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 5d0c93675b..e08b23bb6d 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -342,7 +342,7 @@ slapi_int_ldapmod_to_entry( char *ldn, LDAPMod **mods ) { - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; Entry *pEntry=NULL; LDAPMod *pMod; struct berval *bv; @@ -516,7 +516,7 @@ slapi_delete_internal( Slapi_PBlock *pPB = NULL; Slapi_PBlock *pSavePB = NULL; SlapReply rs = { REP_RESULT }; - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; int manageDsaIt = 0; int isCritical; @@ -763,8 +763,8 @@ slapi_modrdn_internal( int log_change ) { #ifdef LDAP_SLAPI - struct berval dn = { 0, NULL }; - struct berval newrdn = { 0, NULL }; + struct berval dn = BER_BVNULL; + struct berval newrdn = BER_BVNULL; Connection *pConn = NULL; Operation *op = NULL; Slapi_PBlock *pPB = NULL; @@ -893,7 +893,7 @@ slapi_modify_internal( Slapi_PBlock *pPB = NULL; Slapi_PBlock *pSavePB = NULL; - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; int manageDsaIt = 0; int isCritical; @@ -1088,9 +1088,9 @@ slapi_search_internal( Operation *op = NULL; Slapi_PBlock *ptr = NULL; Slapi_PBlock *pSavePB = NULL; - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; Filter *filter=NULL; - struct berval fstr = { 0, NULL }; + struct berval fstr = BER_BVNULL; AttributeName *an = NULL; const char *text = NULL; diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index e95c107795..5b5172e015 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -171,7 +171,7 @@ slapi_entry_set_dn( char *ldn ) { #ifdef LDAP_SLAPI - struct berval dn = { 0, NULL }; + struct berval dn = BER_BVNULL; dn.bv_val = ldn; dn.bv_len = strlen( ldn ); diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 88da2c36d2..5b2f8e8092 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -343,7 +343,7 @@ do_syncrep1( sc = NULL; } else { /* stored cookie */ - struct berval newcookie = { 0, NULL }; + struct berval newcookie = BER_BVNULL; ber_dupbv( &cookie_bv, &cookie[0] ); ber_bvarray_add( &si->si_syncCookie.octet_str, &cookie_bv ); slap_parse_sync_cookie( &si->si_syncCookie ); @@ -434,10 +434,10 @@ do_syncrep2( Entry *entry = NULL; int syncstate; - struct berval syncUUID = { 0, NULL }; + struct berval syncUUID = BER_BVNULL; struct sync_cookie syncCookie = { NULL, -1, NULL }; struct sync_cookie syncCookie_req = { NULL, -1, NULL }; - struct berval cookie = { 0, NULL }; + struct berval cookie = BER_BVNULL; int rc, err, i; ber_len_t len; @@ -1042,8 +1042,8 @@ syncrepl_entry( Backend *be = op->o_bd; slap_callback cb = { NULL }; struct berval *syncuuid_bv = NULL; - struct berval syncUUID_strrep = { 0, NULL }; - struct berval uuid_bv = { 0, NULL }; + struct berval syncUUID_strrep = BER_BVNULL; + struct berval uuid_bv = BER_BVNULL; SlapReply rs = {REP_RESULT}; Filter f = {0}; @@ -1052,11 +1052,11 @@ syncrepl_entry( int ret = LDAP_SUCCESS; const char *text; - struct berval pdn = { 0, NULL }; - struct berval org_req_dn = { 0, NULL }; - struct berval org_req_ndn = { 0, NULL }; - struct berval org_dn = { 0, NULL }; - struct berval org_ndn = { 0, NULL }; + struct berval pdn = BER_BVNULL; + struct berval org_req_dn = BER_BVNULL; + struct berval org_req_ndn = BER_BVNULL; + struct berval org_dn = BER_BVNULL; + struct berval org_ndn = BER_BVNULL; int org_managedsait; if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD )) @@ -1305,11 +1305,11 @@ syncrepl_del_nonpresent( Modifications **modtail = &modlist; Attribute *attr; - struct berval pdn = { 0, NULL }; - struct berval org_req_dn = { 0, NULL }; - struct berval org_req_ndn = { 0, NULL }; - struct berval org_dn = { 0, NULL }; - struct berval org_ndn = { 0, NULL }; + struct berval pdn = BER_BVNULL; + struct berval org_req_dn = BER_BVNULL; + struct berval org_req_ndn = BER_BVNULL; + struct berval org_dn = BER_BVNULL; + struct berval org_ndn = BER_BVNULL; int org_managedsait; op->o_req_dn = si->si_base; diff --git a/servers/slapd/value.c b/servers/slapd/value.c index bf8077c7c6..bbbd318e97 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -217,8 +217,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 +246,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 ) { -- 2.39.5