From: Pierangelo Masarati Date: Wed, 26 Feb 2003 22:58:46 +0000 (+0000) Subject: more SLAP_NVALUES cleanup X-Git-Tag: NO_SLAP_OP_BLOCKS~269 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=216bcd948e22e66361a6c656407750773b70fd4f;p=openldap more SLAP_NVALUES cleanup --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index decf58228a..5a602ea4a4 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -171,7 +171,7 @@ attr_merge_one( AttributeDescription *desc, struct berval *val #ifdef SLAP_NVALUES - , BerVarray nval + , struct berval *nval #endif ) { int rc; diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index bab8871253..e9b6cd7546 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -98,7 +98,7 @@ passwd_back_search( } vals[0] = rdn[0][0]->la_value; - attr_merge( e, desc, vals ); + attr_mergeit( e, desc, vals ); ldap_rdnfree(rdn); rdn = NULL; @@ -112,7 +112,7 @@ passwd_back_search( */ vals[0].bv_val = "organizationalUnit"; vals[0].bv_len = sizeof("organizationalUnit")-1; - attr_merge( e, ad_objectClass, vals ); + attr_mergeit( e, ad_objectClass, vals ); if ( test_filter( be, conn, op, e, filter ) == LDAP_COMPARE_TRUE ) { send_search_entry( be, conn, op, @@ -306,21 +306,21 @@ pw2entry( Backend *be, struct passwd *pw, const char **text ) /* objectclasses should be configurable items */ vals[0].bv_val = "top"; vals[0].bv_len = sizeof("top")-1; - attr_merge( e, ad_objectClass, vals ); + attr_mergeit( e, ad_objectClass, vals ); vals[0].bv_val = "person"; vals[0].bv_len = sizeof("person")-1; - attr_merge( e, ad_objectClass, vals ); + attr_mergeit( e, ad_objectClass, vals ); vals[0].bv_val = "uidObject"; vals[0].bv_len = sizeof("uidObject")-1; - attr_merge( e, ad_objectClass, vals ); + attr_mergeit( e, ad_objectClass, vals ); vals[0].bv_val = pw->pw_name; vals[0].bv_len = pwlen; - attr_merge( e, ad_uid, vals ); /* required by uidObject */ - attr_merge( e, ad_cn, vals ); /* required by person */ - attr_merge( e, ad_sn, vals ); /* required by person */ + attr_mergeit( e, ad_uid, vals ); /* required by uidObject */ + attr_mergeit( e, ad_cn, vals ); /* required by person */ + attr_mergeit( e, ad_sn, vals ); /* required by person */ #ifdef HAVE_PW_GECOS /* @@ -333,7 +333,7 @@ pw2entry( Backend *be, struct passwd *pw, const char **text ) vals[0].bv_val = pw->pw_gecos; vals[0].bv_len = strlen(vals[0].bv_val); - attr_merge(e, ad_description, vals); + attr_mergeit(e, ad_description, vals); s = strchr(vals[0].bv_val, ','); if (s) *s = '\0'; @@ -355,13 +355,13 @@ pw2entry( Backend *be, struct passwd *pw, const char **text ) vals[0].bv_len = strlen(vals[0].bv_val); if ( vals[0].bv_len && strcasecmp( vals[0].bv_val, pw->pw_name )) { - attr_merge( e, ad_cn, vals ); + attr_mergeit( e, ad_cn, vals ); } if ( (s=strrchr(vals[0].bv_val, ' '))) { vals[0].bv_val = s + 1; vals[0].bv_len = strlen(vals[0].bv_val); - attr_merge(e, ad_sn, vals); + attr_mergeit(e, ad_sn, vals); } } #endif diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index e0e0758362..c5cb507770 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -118,6 +118,7 @@ schema_info( Entry **entry, const char **text ) #ifdef SLAP_NVALUES nvals[0].bv_val = strchr( global_schemandn.bv_val, '=' ); + assert( nvals[0].bv_val ); nvals[0].bv_val++; nvals[0].bv_len = global_schemandn.bv_len - (nvals[0].bv_val - global_schemandn.bv_val); diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 3c498d4f14..77052eb3f8 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -257,7 +257,7 @@ slapi_entry_attr_merge( return -1; } - rc = attr_merge( e, ad, bv ); + rc = attr_mergeit( e, ad, bv ); ch_free( bv ); return rc; @@ -469,7 +469,7 @@ slapi_entry_attr_set_charptr(Slapi_Entry* e, const char *type, const char *value if ( value != NULL ) { bv.bv_val = (char *)value; bv.bv_len = strlen(value); - attr_merge_one ( e, ad, &bv ); + attr_mergeit_one( e, ad, &bv ); } #endif /* LDAP_SLAPI */ } @@ -599,7 +599,7 @@ slapi_entry_add_valueset(Slapi_Entry *e, const char *type, Slapi_ValueSet *vs) return -1; } - return attr_merge( e, ad, *vs ); + return attr_mergeit( e, ad, *vs ); #else return -1; #endif /* LDAP_SLAPI */ @@ -682,7 +682,7 @@ slapi_entry_add_value(Slapi_Entry *e, const char *type, const Slapi_Value *value return -1; } - rc = attr_merge_one( e, ad, (Slapi_Value *)value ); + rc = attr_mergeit_one( e, ad, (Slapi_Value *)value ); if ( rc != LDAP_SUCCESS ) { return -1; } @@ -794,7 +794,7 @@ slapi_entry_attr_replace_sv( Slapi_Entry *e, const char *type, Slapi_Value **val return -1; } - rc = attr_merge( e, ad, bv ); + rc = attr_mergeit( e, ad, bv ); slapi_ch_free( (void **)&bv ); if ( rc != LDAP_SUCCESS ) { return -1;