struct berval mdn = { 0, NULL }, mapped;
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "meta_back_add: %s\n",
- e->e_dn ));
+ LDAP_LOG( BACK_META, ENTRY, "meta_back_add: %s\n", e->e_dn, 0, 0 );
#else /* !NEW_LOGGING */
Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n%s%s", e->e_dn, "", "");
#endif /* !NEW_LOGGING */
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "[rw] addDn: \"%s\" -> \"%s\"\n",
- e->e_dn, mdn.bv_val ));
+ LDAP_LOG( BACK_META, DETAIL1,
+ "[rw] addDn: \"%s\" -> \"%s\"\n", e->e_dn, mdn.bv_val, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS, "rw> addDn: \"%s\" -> \"%s\"\n%s",
e->e_dn, mdn.bv_val, "" );
attrs = ch_malloc( sizeof( LDAPMod * )*i );
for ( i = 0, a = e->e_attrs; a; a = a->a_next ) {
+ int j;
/*
* lastmod should always be <off>, so that
* creation/modification operational attrs
a->a_vals, conn );
}
- attrs[ i ]->mod_vals.modv_bvals = a->a_vals;
+ for (j=0; a->a_vals[ j ].bv_val; j++);
+ attrs[ i ]->mod_vals.modv_bvals = ch_malloc((j+1)*sizeof(struct berval *));
+ for (j=0; a->a_vals[ j ].bv_val; j++)
+ attrs[ i ]->mod_vals.modv_bvals[ j ] = &a->a_vals[ j ];
+ attrs[ i ]->mod_vals.modv_bvals[ j ] = NULL;
i++;
}
attrs[ i ] = NULL;
ldap_add_s( lc->conns[ candidate ]->ld, mdn.bv_val, attrs );
for ( --i; i >= 0; --i ) {
+ free( attrs[ i ]->mod_vals.modv_bvals );
free( attrs[ i ] );
}
free( attrs );