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 ) {
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;
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 ) )
{
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;
}
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 );
Entry *e,
AttributeDescription *desc,
BerVarray vals,
- BerVarray nvals
-) {
+ BerVarray nvals )
+{
int rc;
Attribute **a;
Entry *e,
AttributeDescription *desc,
BerVarray vals,
- void *memctx
-) {
+ void *memctx )
+{
BerVarray nvals = NULL;
int rc;
Entry *e,
AttributeDescription *desc,
struct berval *val,
- struct berval *nval
-) {
+ struct berval *nval )
+{
int rc;
Attribute **a;
Entry *e,
AttributeDescription *desc,
struct berval *val,
- void *memctx
-) {
+ void *memctx )
+{
struct berval nval;
struct berval *nvalp;
int rc;
Attribute *
attrs_find(
Attribute *a,
- AttributeDescription *desc
-)
+ AttributeDescription *desc )
{
for ( ; a != NULL; a = a->a_next ) {
if ( is_ad_subtype( a->a_desc, desc ) ) {
Attribute *
attr_find(
Attribute *a,
- AttributeDescription *desc
-)
+ AttributeDescription *desc )
{
for ( ; a != NULL; a = a->a_next ) {
if ( ad_cmp( a->a_desc, desc ) == 0 ) {
int
attr_delete(
Attribute **attrs,
- AttributeDescription *desc
-)
+ AttributeDescription *desc )
{
Attribute **a;
BerElement *ber,
AttributeAssertion **ava,
unsigned usage,
- const char **text
-)
+ const char **text )
{
int rc;
ber_tag_t rtag;
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;
)
{
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;
} else if ( rc == 0 ) {
void *ssl;
- struct berval authid = { 0, NULL };
+ struct berval authid = BER_BVNULL;
c->c_needs_tls_accept = 0;
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
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 );
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;
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 );
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 );
)
{
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 )
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;
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;
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;
mr = NULL;
}
- if( mr == NULL ) {
- continue;
-
- }
+ if( mr == NULL ) continue;
bv = a->a_nvals;
for ( j=0; bv->bv_val != NULL; bv++, j++ ) {
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);
{
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 */
* 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;
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" );
}
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 );
}
} 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] == '\'' )
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] == '\'' )
{
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;
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 );
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;
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;
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;
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;
{
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;
int
value_add(
BerVarray *vals,
- BerVarray addvals
-)
+ BerVarray addvals )
{
int n, nn;
BerVarray v2;
int
value_add_one(
BerVarray *vals,
- struct berval *addval
-)
+ struct berval *addval )
{
int n;
BerVarray v2;
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 );
{
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 ) {