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

use BER_BVNULL

parent bd7cd426
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 ) {
......
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