pass ConfigReply into overlay_config() to allow progating error messages

back through back-config
This commit is contained in:
Ralf Haferkamp 2008-05-30 14:49:24 +00:00
parent e9bf842951
commit 9d72509d05
5 changed files with 12 additions and 7 deletions

View File

@ -1099,7 +1099,7 @@ glue_sub_attach()
/* 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;
}

View File

@ -1143,7 +1143,7 @@ overlay_move( BackendDB *be, slap_overinst *on, int idx )
/* 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;
@ -1278,7 +1278,7 @@ overlay_config( BackendDB *be, const char *ov, int idx, BackendInfo **res )
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;

View File

@ -2140,13 +2140,13 @@ config_overlay(ConfigArgs *c) {
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);

View File

@ -2093,7 +2093,12 @@ ppolicy_db_init(
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;
}
}

View File

@ -435,7 +435,7 @@ LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be );
*/
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 ));