int
ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags )
{
- struct berval bv = { 0, (char *)str };
+ struct berval bv;
assert( str );
bv.bv_len = strlen( str );
+ bv.bv_val = (char *) str;
return ldap_bv2dn( &bv, dn, flags );
}
for ( ; p < end; p++ ) {
int err;
- struct berval tmpbv = { bv->bv_len - ( p - str ), (char *)p };
+ struct berval tmpbv;
+ tmpbv.bv_len = bv->bv_len - ( p - str );
+ tmpbv.bv_val = (char *)p;
err = ldap_bv2rdn( &tmpbv, &newRDN, (char **) &p, flags );
if ( err != LDAP_SUCCESS ) {
ldap_str2rdn( LDAP_CONST char *str, LDAPRDN **rdn,
char **n_in, unsigned flags )
{
- struct berval bv = { 0, (char *)str };
+ struct berval bv;
assert( str );
assert( str[ 0 ] != '\0' ); /* FIXME: is this required? */
bv.bv_len = strlen( str );
+ bv.bv_val = (char *) str;
return ldap_bv2rdn( &bv, rdn, n_in, flags );
}
if ( b->a_group_pat.bv_len && op->o_ndn.bv_len ) {
char buf[1024];
- struct berval bv = { sizeof(buf) - 1, buf };
+ struct berval bv;
struct berval ndn = { 0, NULL };
int rc;
+ bv.bv_len = sizeof(buf) - 1;
+ bv.bv_val = buf;
+
/* b->a_group is an unexpanded entry name, expanded it should be an
* entry with objectclass group* and we test to see if odn is one of
* the values in the attribute group
{
regex_t re;
char newbuf[512];
- struct berval bv = {sizeof(newbuf), newbuf};
+ struct berval bv;
int rc;
+ bv.bv_len = sizeof(newbuf);
+ bv.bv_val = newbuf;
+
if(str == NULL) str = "";
string_expand(&bv, pat, buf, matches);
long stoptime = 0;
struct berval bv;
glue_state gs = {0};
- slap_callback cb = {glue_back_response, glue_back_sresult,
- glue_back_sendentry, &gs};
+ slap_callback cb;
+
+ cb.sc_response = glue_back_response;
+ cb.sc_sresult = glue_back_sresult;
+ cb.sc_sendentry = glue_back_sendentry;
+ cb.sc_private = &gs;
gs.prevcb = op->o_callback;
a = NULL;
while (i = entry_getlen(&ptr)) {
- struct berval bv = { i, ptr };
+ struct berval bv;
+ bv.bv_len = i;
+ bv.bv_val = ptr;
if (a) {
a->a_next = (Attribute *)bptr;
}
{
BerVarray vals, nset;
char attrstr[32];
- struct berval bv = {attr->bv_len, attrstr};
+ struct berval bv;
int i;
+ bv.bv_len = attr->bv_len;
+ bv.bv_val = attrstr;
+
if (set == NULL)
return(ch_calloc(1, sizeof(struct berval)));
while( ldif_read_record( ldiffp, &lineno, &buf, &lmax ) ) {
Entry *e = str2entry( buf );
- struct berval bvtext = { textlen, textbuf };
+ struct berval bvtext;
+
+ bvtext.bv_len = textlen;
+ bvtext.bv_val = textbuf;
if( e == NULL ) {
fprintf( stderr, "%s: could not parse entry (line=%d)\n",