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

use BER_BVNULL

parent bd7cd426
......@@ -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,
......
......@@ -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 ] ) {
......
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
......@@ -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 );
......
......@@ -40,7 +40,7 @@ static struct berval
BER_BVC( "Search" ),
BER_BVC( "Abandon" ),
BER_BVC( "Extended" ),
{ 0, NULL }
BER_BVNULL
};
int
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 ) {
......
......@@ -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
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
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