/* If it's not already configured, set up the overlay */
if ( !SLAP_GLUE_INSTANCE( be )) {
- rc = overlay_config( be, glue.on_bi.bi_type, -1, NULL );
+ rc = overlay_config( be, glue.on_bi.bi_type, -1, NULL, NULL);
if ( rc )
break;
}
/* add an overlay to a particular backend. */
int
-overlay_config( BackendDB *be, const char *ov, int idx, BackendInfo **res )
+overlay_config( BackendDB *be, const char *ov, int idx, BackendInfo **res, ConfigReply *cr )
{
slap_overinst *on = NULL, *on2 = NULL, **prev;
slap_overinfo *oi = NULL;
if ( on2->on_bi.bi_db_init ) {
int rc;
be->bd_info = (BackendInfo *)on2;
- rc = on2->on_bi.bi_db_init( be, NULL );
+ rc = on2->on_bi.bi_db_init( be, cr);
be->bd_info = (BackendInfo *)oi;
if ( rc ) {
*prev = on2->on_next;
assert(0);
}
if(c->argv[1][0] == '-' && overlay_config(c->be, &c->argv[1][1],
- c->valx, &c->bi)) {
+ c->valx, &c->bi, &c->reply)) {
/* log error */
Debug( LDAP_DEBUG_ANY,
"%s: (optional) %s overlay \"%s\" configuration failed.\n",
c->log, c->be == frontendDB ? "global " : "", &c->argv[1][1]);
return 1;
- } else if(overlay_config(c->be, c->argv[1], c->valx, &c->bi)) {
+ } else if(overlay_config(c->be, c->argv[1], c->valx, &c->bi, &c->reply)) {
return(1);
}
return(0);
for (i=0; pwd_UsSchema[i].def; i++) {
code = slap_str2ad( pwd_UsSchema[i].def, pwd_UsSchema[i].ad, &err );
if ( code ) {
- fprintf( stderr, "User Schema Load failed %d: %s\n", code, err );
+ if ( cr ){
+ snprintf( cr->msg, sizeof(cr->msg),
+ "User Schema load failed for attribute \"%s\". Error code %d: %s",
+ pwd_UsSchema[i].def, code, err );
+ fprintf( stderr, "%s\n", cr->msg );
+ }
return code;
}
}
*/
LDAP_SLAPD_F (int) overlay_register LDAP_P(( slap_overinst *on ));
LDAP_SLAPD_F (int) overlay_config LDAP_P(( BackendDB *be, const char *ov,
- int idx, BackendInfo **res ));
+ int idx, BackendInfo **res, ConfigReply *cr ));
LDAP_SLAPD_F (void) overlay_destroy_one LDAP_P((
BackendDB *be,
slap_overinst *on ));