Commit 44725e73 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

use BER_BVNULL

parent bd7cd426
...@@ -1207,7 +1207,7 @@ dn_match_cleanup:; ...@@ -1207,7 +1207,7 @@ dn_match_cleanup:;
if ( b->a_group_pat.bv_len ) { if ( b->a_group_pat.bv_len ) {
struct berval bv; struct berval bv;
struct berval ndn = { 0, NULL }; struct berval ndn = BER_BVNULL;
int rc; int rc;
if ( op->o_ndn.bv_len == 0 ) { if ( op->o_ndn.bv_len == 0 ) {
...@@ -1763,14 +1763,14 @@ aci_match_set ( ...@@ -1763,14 +1763,14 @@ aci_match_set (
int setref int setref
) )
{ {
struct berval set = { 0, NULL }; struct berval set = BER_BVNULL;
int rc = 0; int rc = 0;
AciSetCookie cookie; AciSetCookie cookie;
if (setref == 0) { if (setref == 0) {
ber_dupbv_x( &set, subj, op->o_tmpmemctx ); ber_dupbv_x( &set, subj, op->o_tmpmemctx );
} else { } else {
struct berval subjdn, ndn = { 0, NULL }; struct berval subjdn, ndn = BER_BVNULL;
struct berval setat; struct berval setat;
BerVarray bvals; BerVarray bvals;
const char *text; const char *text;
......
...@@ -1875,7 +1875,7 @@ print_acl( Backend *be, AccessControl *a ) ...@@ -1875,7 +1875,7 @@ print_acl( Backend *be, AccessControl *a )
} }
if ( a->acl_filter != NULL ) { if ( a->acl_filter != NULL ) {
struct berval bv = { 0, NULL }; struct berval bv = BER_BVNULL;
to++; to++;
filter2bv( a->acl_filter, &bv ); filter2bv( a->acl_filter, &bv );
fprintf( stderr, " filter=%s\n", bv.bv_val ); fprintf( stderr, " filter=%s\n", bv.bv_val );
......
...@@ -46,7 +46,7 @@ do_add( Operation *op, SlapReply *rs ) ...@@ -46,7 +46,7 @@ do_add( Operation *op, SlapReply *rs )
{ {
BerElement *ber = op->o_ber; BerElement *ber = op->o_ber;
char *last; char *last;
struct berval dn = { 0, NULL }; struct berval dn = BER_BVNULL;
ber_len_t len; ber_len_t len;
ber_tag_t tag; ber_tag_t tag;
Entry *e; Entry *e;
......
...@@ -39,7 +39,7 @@ bdb_csn_commit( ...@@ -39,7 +39,7 @@ bdb_csn_commit(
) )
{ {
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; 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; EntryInfo *ctxcsn_ei = NULL;
DB_LOCK ctxcsn_lock; DB_LOCK ctxcsn_lock;
struct berval max_committed_csn; struct berval max_committed_csn;
......
...@@ -36,7 +36,7 @@ static const struct bdbi_database { ...@@ -36,7 +36,7 @@ static const struct bdbi_database {
{ NULL, NULL, 0, 0 } { 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_malloc(size_t);
typedef void * db_realloc(void *, size_t); typedef void * db_realloc(void *, size_t);
......
...@@ -376,7 +376,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, ...@@ -376,7 +376,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
Entry *e = NULL, base; Entry *e = NULL, base;
Entry *matched = NULL; Entry *matched = NULL;
EntryInfo *ei; EntryInfo *ei;
struct berval realbase = { 0, NULL }; struct berval realbase = BER_BVNULL;
int manageDSAit; int manageDSAit;
int tentries = 0; int tentries = 0;
ID lastid = NOID; ID lastid = NOID;
...@@ -558,7 +558,7 @@ dn2entry_retry: ...@@ -558,7 +558,7 @@ dn2entry_retry:
} }
if ( e == NULL ) { if ( e == NULL ) {
struct berval matched_dn = { 0, NULL }; struct berval matched_dn = BER_BVNULL;
if ( matched != NULL ) { if ( matched != NULL ) {
BerVarray erefs; BerVarray erefs;
...@@ -1674,7 +1674,7 @@ send_pagerequest_response( ...@@ -1674,7 +1674,7 @@ send_pagerequest_response(
LDAPControl ctrl, *ctrls[2]; LDAPControl ctrl, *ctrls[2];
BerElementBuffer berbuf; BerElementBuffer berbuf;
BerElement *ber = (BerElement *)&berbuf; BerElement *ber = (BerElement *)&berbuf;
struct berval cookie = { 0, NULL }; struct berval cookie = BER_BVNULL;
PagedResultsCookie respcookie; PagedResultsCookie respcookie;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
......
...@@ -41,7 +41,7 @@ dnssrv_back_search( ...@@ -41,7 +41,7 @@ dnssrv_back_search(
char *hostlist = NULL; char *hostlist = NULL;
char **hosts = NULL; char **hosts = NULL;
char *refdn; char *refdn;
struct berval nrefdn = { 0, NULL }; struct berval nrefdn = BER_BVNULL;
BerVarray urls = NULL; BerVarray urls = NULL;
int manageDSAit; int manageDSAit;
......
...@@ -42,7 +42,7 @@ ldap_back_add( ...@@ -42,7 +42,7 @@ ldap_back_add(
Attribute *a; Attribute *a;
LDAPMod **attrs; LDAPMod **attrs;
struct berval mapped; struct berval mapped;
struct berval mdn = { 0, NULL }; struct berval mdn = BER_BVNULL;
ber_int_t msgid; ber_int_t msgid;
dncookie dc; dncookie dc;
int isupdate; int isupdate;
......
...@@ -45,7 +45,7 @@ ldap_back_bind( ...@@ -45,7 +45,7 @@ ldap_back_bind(
struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private;
struct ldapconn *lc; struct ldapconn *lc;
struct berval mdn = { 0, NULL }; struct berval mdn = BER_BVNULL;
int rc = 0; int rc = 0;
ber_int_t msgid; ber_int_t msgid;
dncookie dc; dncookie dc;
......
...@@ -38,8 +38,8 @@ ldap_back_compare( ...@@ -38,8 +38,8 @@ ldap_back_compare(
{ {
struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private;
struct ldapconn *lc; struct ldapconn *lc;
struct berval mapped_at = { 0, NULL }, mapped_val = { 0, NULL }; struct berval mapped_at = BER_BVNULL, mapped_val = BER_BVNULL;
struct berval mdn = { 0, NULL }; struct berval mdn = BER_BVNULL;
ber_int_t msgid; ber_int_t msgid;
int freeval = 0; int freeval = 0;
dncookie dc; dncookie dc;
......
...@@ -45,7 +45,7 @@ ldap_back_delete( ...@@ -45,7 +45,7 @@ ldap_back_delete(
int rc = LDAP_SUCCESS; int rc = LDAP_SUCCESS;
#endif /* LDAP_BACK_PROXY_AUTHZ */ #endif /* LDAP_BACK_PROXY_AUTHZ */
struct berval mdn = { 0, NULL }; struct berval mdn = BER_BVNULL;
lc = ldap_back_getconn( op, rs ); lc = ldap_back_getconn( op, rs );
......
...@@ -96,7 +96,7 @@ ldap_back_exop_passwd( ...@@ -96,7 +96,7 @@ ldap_back_exop_passwd(
struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private;
struct ldapconn *lc; struct ldapconn *lc;
req_pwdexop_s *qpw = &op->oq_pwdexop; req_pwdexop_s *qpw = &op->oq_pwdexop;
struct berval mdn = { 0, NULL }, newpw; struct berval mdn = BER_BVNULL, newpw;
LDAPMessage *res; LDAPMessage *res;
ber_int_t msgid; ber_int_t msgid;
int rc, isproxy; int rc, isproxy;
......
...@@ -43,7 +43,7 @@ ldap_back_modify( ...@@ -43,7 +43,7 @@ ldap_back_modify(
Modifications *ml; Modifications *ml;
int i, j, rc; int i, j, rc;
struct berval mapped; struct berval mapped;
struct berval mdn = { 0, NULL }; struct berval mdn = BER_BVNULL;
ber_int_t msgid; ber_int_t msgid;
dncookie dc; dncookie dc;
int isupdate; int isupdate;
......
...@@ -45,7 +45,7 @@ ldap_back_modrdn( ...@@ -45,7 +45,7 @@ ldap_back_modrdn(
int rc = LDAP_SUCCESS; int rc = LDAP_SUCCESS;
#endif /* LDAP_BACK_PROXY_AUTHZ */ #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 ); lc = ldap_back_getconn( op, rs );
if ( !lc || !ldap_back_dobind(lc, op, rs) ) { if ( !lc || !ldap_back_dobind(lc, op, rs) ) {
......
...@@ -42,7 +42,7 @@ ldap_build_entry( Operation *op, LDAPMessage *e, Entry *ent, ...@@ -42,7 +42,7 @@ ldap_build_entry( Operation *op, LDAPMessage *e, Entry *ent,
#define LDAP_BUILD_ENTRY_PRIVATE 0x01 #define LDAP_BUILD_ENTRY_PRIVATE 0x01
#define LDAP_BUILD_ENTRY_NORMALIZE 0x02 #define LDAP_BUILD_ENTRY_NORMALIZE 0x02
static struct berval dummy = { 0, NULL }; static struct berval dummy = BER_BVNULL;
int int
ldap_back_search( ldap_back_search(
...@@ -54,10 +54,10 @@ ldap_back_search( ...@@ -54,10 +54,10 @@ ldap_back_search(
struct timeval tv; struct timeval tv;
LDAPMessage *res, *e; LDAPMessage *res, *e;
int rc = 0, msgid; int rc = 0, msgid;
struct berval match = { 0, NULL }; struct berval match = BER_BVNULL;
char **mapped_attrs = NULL; char **mapped_attrs = NULL;
struct berval mbase; struct berval mbase;
struct berval mfilter = { 0, NULL }; struct berval mfilter = BER_BVNULL;
int dontfreetext = 0; int dontfreetext = 0;
dncookie dc; dncookie dc;
#ifdef LDAP_BACK_PROXY_AUTHZ #ifdef LDAP_BACK_PROXY_AUTHZ
...@@ -532,7 +532,7 @@ ldap_back_entry_get( ...@@ -532,7 +532,7 @@ ldap_back_entry_get(
struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private; struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private;
struct ldapconn *lc; struct ldapconn *lc;
int rc = 1, is_oc; int rc = 1, is_oc;
struct berval mapped = { 0, NULL }, bdn, mdn; struct berval mapped = BER_BVNULL, bdn, mdn;
LDAPMessage *result = NULL, *e = NULL; LDAPMessage *result = NULL, *e = NULL;
char *gattr[3]; char *gattr[3];
char *filter = NULL; char *filter = NULL;
......
...@@ -42,8 +42,8 @@ ldbm_back_modrdn( ...@@ -42,8 +42,8 @@ ldbm_back_modrdn(
AttributeDescription *entry = slap_schema.si_ad_entry; AttributeDescription *entry = slap_schema.si_ad_entry;
struct ldbminfo *li = (struct ldbminfo *) op->o_bd->be_private; struct ldbminfo *li = (struct ldbminfo *) op->o_bd->be_private;
struct berval p_dn, p_ndn; struct berval p_dn, p_ndn;
struct berval new_dn = { 0, NULL}, new_ndn = { 0, NULL }; struct berval new_dn = BER_BVNULL, new_ndn = BER_BVNULL;
struct berval old_ndn = { 0, NULL }; struct berval old_ndn = BER_BVNULL;
Entry *e, *p = NULL; Entry *e, *p = NULL;
Entry *matched; Entry *matched;
/* LDAP v2 supporting correct attribute handling. */ /* LDAP v2 supporting correct attribute handling. */
......
...@@ -46,7 +46,7 @@ ldbm_back_search( ...@@ -46,7 +46,7 @@ ldbm_back_search(
ID id, cursor; ID id, cursor;
Entry *e; Entry *e;
Entry *matched = NULL; Entry *matched = NULL;
struct berval realbase = { 0, NULL }; struct berval realbase = BER_BVNULL;
int manageDSAit = get_manageDSAit( op ); int manageDSAit = get_manageDSAit( op );
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
...@@ -86,7 +86,7 @@ ldbm_back_search( ...@@ -86,7 +86,7 @@ ldbm_back_search(
} }
if ( e == NULL ) { if ( e == NULL ) {
struct berval matched_dn = { 0, NULL }; struct berval matched_dn = BER_BVNULL;
if ( matched != NULL ) { if ( matched != NULL ) {
BerVarray erefs; BerVarray erefs;
......
...@@ -40,7 +40,7 @@ meta_back_add( Operation *op, SlapReply *rs ) ...@@ -40,7 +40,7 @@ meta_back_add( Operation *op, SlapReply *rs )
int i, candidate = -1; int i, candidate = -1;
Attribute *a; Attribute *a;
LDAPMod **attrs; LDAPMod **attrs;
struct berval mdn = { 0, NULL }, mapped; struct berval mdn = BER_BVNULL, mapped;
dncookie dc; dncookie dc;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
......
...@@ -191,7 +191,7 @@ meta_back_do_single_bind( ...@@ -191,7 +191,7 @@ meta_back_do_single_bind(
) )
{ {
struct metainfo *li = ( struct metainfo * )op->o_bd->be_private; struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
struct berval mdn = { 0, NULL }; struct berval mdn = BER_BVNULL;
ber_int_t msgid; ber_int_t msgid;
dncookie dc; dncookie dc;
struct metasingleconn *lsc = &lc->conns[ candidate ]; struct metasingleconn *lsc = &lc->conns[ candidate ];
......
...@@ -38,7 +38,7 @@ meta_back_compare( Operation *op, SlapReply *rs ) ...@@ -38,7 +38,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
struct metaconn *lc; struct metaconn *lc;
struct metasingleconn *lsc; struct metasingleconn *lsc;
char *match = NULL, *err = NULL; 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 candidates = 0, last = 0, i, count = 0, rc;
int cres = LDAP_SUCCESS, rres = LDAP_SUCCESS; int cres = LDAP_SUCCESS, rres = LDAP_SUCCESS;
int *msgid; int *msgid;
...@@ -70,7 +70,7 @@ meta_back_compare( Operation *op, SlapReply *rs ) ...@@ -70,7 +70,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
dc.ctx = "compareDN"; dc.ctx = "compareDN";
for ( i = 0, lsc = lc->conns; !META_LAST(lsc); ++i, ++lsc ) { 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_attr = op->oq_compare.rs_ava->aa_desc->ad_cname;
struct berval mapped_value = op->oq_compare.rs_ava->aa_value; struct berval mapped_value = op->oq_compare.rs_ava->aa_value;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment