From 3a9310431e4e90005c1d7573c2b8f492cbf0cd0d Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Fri, 3 Aug 2007 12:02:07 +0000 Subject: [PATCH] Reworked recent backend API changes, now using a separate struct, (ConfigReply) for the error messages. --- servers/slapd/back-bdb/init.c | 17 ++- servers/slapd/back-dnssrv/init.c | 4 +- servers/slapd/back-ldap/chain.c | 16 +-- servers/slapd/back-ldap/config.c | 112 +++++++-------- servers/slapd/back-ldap/distproc.c | 12 +- servers/slapd/back-ldap/init.c | 8 +- servers/slapd/back-ldif/ldif.c | 6 +- servers/slapd/back-meta/init.c | 6 +- servers/slapd/back-monitor/init.c | 6 +- servers/slapd/back-null/null.c | 4 +- servers/slapd/back-perl/close.c | 2 +- servers/slapd/back-perl/init.c | 4 +- servers/slapd/back-relay/init.c | 8 +- servers/slapd/back-shell/init.c | 4 +- servers/slapd/back-sql/init.c | 8 +- servers/slapd/backend.c | 13 +- servers/slapd/backglue.c | 6 +- servers/slapd/backover.c | 6 +- servers/slapd/bconfig.c | 207 ++++++++++++++------------- servers/slapd/config.c | 64 ++++----- servers/slapd/config.h | 8 +- servers/slapd/oidm.c | 12 +- servers/slapd/overlays/accesslog.c | 20 +-- servers/slapd/overlays/auditlog.c | 6 +- servers/slapd/overlays/constraint.c | 14 +- servers/slapd/overlays/dds.c | 52 +++---- servers/slapd/overlays/dyngroup.c | 2 +- servers/slapd/overlays/dynlist.c | 58 ++++---- servers/slapd/overlays/pcache.c | 114 +++++++-------- servers/slapd/overlays/ppolicy.c | 6 +- servers/slapd/overlays/refint.c | 12 +- servers/slapd/overlays/retcode.c | 6 +- servers/slapd/overlays/rwm.c | 6 +- servers/slapd/overlays/seqmod.c | 4 +- servers/slapd/overlays/syncprov.c | 32 ++--- servers/slapd/overlays/translucent.c | 12 +- servers/slapd/overlays/unique.c | 52 +++---- servers/slapd/overlays/valsort.c | 28 ++-- servers/slapd/proto-slap.h | 5 +- servers/slapd/schemaparse.c | 40 +++--- servers/slapd/slap.h | 4 +- servers/slapd/syncrepl.c | 92 ++++++------ 42 files changed, 555 insertions(+), 543 deletions(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index df6c27d06b..4b5f012335 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -47,7 +47,7 @@ typedef void * db_realloc(void *, size_t); #define bdb_db_close BDB_SYMBOL(db_close) static int -bdb_db_init( BackendDB *be, ConfigArgs *ca ) +bdb_db_init( BackendDB *be, ConfigReply *cr ) { struct bdb_info *bdb; int rc; @@ -94,10 +94,10 @@ bdb_db_init( BackendDB *be, ConfigArgs *ca ) } static int -bdb_db_close( BackendDB *be, ConfigArgs *ca ); +bdb_db_close( BackendDB *be, ConfigReply *cr ); static int -bdb_db_open( BackendDB *be, ConfigArgs *ca ) +bdb_db_open( BackendDB *be, ConfigReply *cr ) { int rc, i; struct bdb_info *bdb = (struct bdb_info *) be->be_private; @@ -122,8 +122,11 @@ bdb_db_open( BackendDB *be, ConfigArgs *ca ) #ifndef BDB_MULTIPLE_SUFFIXES if ( be->be_suffix[1].bv_val ) { - Debug( LDAP_DEBUG_ANY, - LDAP_XSTRING(bdb_db_open) ": only one suffix allowed\n", 0, 0, 0 ); + if (cr) { + snprintf(cr->msg, sizeof(cr->msg), "only one suffix allowed"); + Debug( LDAP_DEBUG_ANY, + LDAP_XSTRING(bdb_db_open) ": %s\n", cr->msg, 0, 0 ); + } return -1; } #endif @@ -480,7 +483,7 @@ fail: } static int -bdb_db_close( BackendDB *be, ConfigArgs *ca ) +bdb_db_close( BackendDB *be, ConfigReply *cr ) { int rc; struct bdb_info *bdb = (struct bdb_info *) be->be_private; @@ -575,7 +578,7 @@ bdb_db_close( BackendDB *be, ConfigArgs *ca ) } static int -bdb_db_destroy( BackendDB *be, ConfigArgs *ca ) +bdb_db_destroy( BackendDB *be, ConfigReply *cr ) { struct bdb_info *bdb = (struct bdb_info *) be->be_private; diff --git a/servers/slapd/back-dnssrv/init.c b/servers/slapd/back-dnssrv/init.c index 9a5ac2bdfe..0e5baca33b 100644 --- a/servers/slapd/back-dnssrv/init.c +++ b/servers/slapd/back-dnssrv/init.c @@ -93,7 +93,7 @@ dnssrv_back_open( int dnssrv_back_db_init( Backend *be, - ConfigArgs *ca) + ConfigReply *cr) { return 0; } @@ -101,7 +101,7 @@ dnssrv_back_db_init( int dnssrv_back_db_destroy( Backend *be, - ConfigArgs *ca ) + ConfigReply *cr ) { return 0; } diff --git a/servers/slapd/back-ldap/chain.c b/servers/slapd/back-ldap/chain.c index 102374a40c..509a65b187 100644 --- a/servers/slapd/back-ldap/chain.c +++ b/servers/slapd/back-ldap/chain.c @@ -1217,9 +1217,9 @@ ldap_chain_cfadd_apply( void *datum, void *arg ) struct berval bv; /* FIXME: should not hardcode "olcDatabase" here */ - bv.bv_len = snprintf( lca->ca->msg, sizeof( lca->ca->msg ), + bv.bv_len = snprintf( lca->ca->cr_msg, sizeof( lca->ca->cr_msg ), "olcDatabase={%d}%s", lca->count, lback->bi_type ); - bv.bv_val = lca->ca->msg; + bv.bv_val = lca->ca->cr_msg; lca->ca->be->be_private = (void *)li; config_build_entry( lca->op, lca->rs, lca->p->e_private, lca->ca, @@ -1479,11 +1479,11 @@ chain_cf_gen( ConfigArgs *c ) case CH_MAX_DEPTH: if ( c->value_int < 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid max referral depth %d", c->argv[0], c->value_int ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); rc = 1; break; } @@ -1507,7 +1507,7 @@ chain_cf_gen( ConfigArgs *c ) static int ldap_chain_db_init( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; ldap_chain_t *lc = NULL; @@ -1739,7 +1739,7 @@ ldap_chain_db_func( static int ldap_chain_db_open( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private; @@ -1772,7 +1772,7 @@ ldap_chain_db_open( static int ldap_chain_db_close( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { return ldap_chain_db_func( be, db_close ); } @@ -1780,7 +1780,7 @@ ldap_chain_db_close( static int ldap_chain_db_destroy( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private; diff --git a/servers/slapd/back-ldap/config.c b/servers/slapd/back-ldap/config.c index 21d381c518..03acdaab74 100644 --- a/servers/slapd/back-ldap/config.c +++ b/servers/slapd/back-ldap/config.c @@ -554,11 +554,11 @@ slap_idassert_authzfrom_parse( ConfigArgs *c, slap_idassert_t *si ) || strcasecmp( c->argv[ 1 ], "dn.regex:.*" ) == 0 ) { if ( si->si_authz != NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-authzFrom \": " "\"%s\" conflicts with existing authz rules", c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -567,20 +567,20 @@ slap_idassert_authzfrom_parse( ConfigArgs *c, slap_idassert_t *si ) return 0; } else if ( ( si->si_flags & LDAP_BACK_AUTH_AUTHZ_ALL ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-authzFrom \": " "\"\" conflicts with \"*\"" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } ber_str2bv( c->argv[ 1 ], 0, 0, &in ); rc = authzNormalize( 0, NULL, NULL, &in, &bv, NULL ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-authzFrom \": " "invalid syntax" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -601,11 +601,11 @@ slap_idassert_parse( ConfigArgs *c, slap_idassert_t *si ) j = verb_to_mask( argvi, idassert_mode ); if ( BER_BVISNULL( &idassert_mode[ j ].word ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-bind \": " "unknown mode \"%s\"", argvi ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -616,11 +616,11 @@ slap_idassert_parse( ConfigArgs *c, slap_idassert_t *si ) if ( strcasecmp( argvi, "native" ) == 0 ) { if ( si->si_bc.sb_method != LDAP_AUTH_SASL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-bind \": " "authz=\"native\" incompatible " "with auth method" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } si->si_flags |= LDAP_BACK_AUTH_NATIVE_AUTHZ; @@ -629,11 +629,11 @@ slap_idassert_parse( ConfigArgs *c, slap_idassert_t *si ) si->si_flags &= ~LDAP_BACK_AUTH_NATIVE_AUTHZ; } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-bind \": " "unknown authz \"%s\"", argvi ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -643,11 +643,11 @@ slap_idassert_parse( ConfigArgs *c, slap_idassert_t *si ) int j, err = 0; if ( flags == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-bind \": " "unable to parse flags \"%s\"", argvi ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -691,11 +691,11 @@ slap_idassert_parse( ConfigArgs *c, slap_idassert_t *si ) } } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-bind \": " "unknown flag \"%s\"", flags[ j ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); err = 1; break; } @@ -1297,11 +1297,11 @@ ldap_back_cf_gen( ConfigArgs *c ) why = "unknown reason"; break; } - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to parse uri \"%s\" " "in \"uri \" line: %s", c->value_string, why ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); urlrc = 1; goto done_url; } @@ -1317,13 +1317,13 @@ ldap_back_cf_gen( ConfigArgs *c ) || tmpludp->lud_filter != NULL || tmpludp->lud_exts != NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "warning, only protocol, " "host and port allowed " "in \"uri \" statement " "for uri #%d of \"%s\"", i, c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); } } @@ -1352,12 +1352,12 @@ ldap_back_cf_gen( ConfigArgs *c ) urllist[ i ] = ldap_url_desc2str( &tmplud ); if ( urllist[ i ] == NULL ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to rebuild uri " "in \"uri \" statement " "for \"%s\"", c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); urlrc = 1; goto done_url; } @@ -1413,11 +1413,11 @@ done_url:; break; default: - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "\"acl-authcDN \" incompatible " "with auth method %d", li->li_acl_authmethod ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } if ( !BER_BVISNULL( &li->li_acl_authcDN ) ) { @@ -1439,11 +1439,11 @@ done_url:; break; default: - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"acl-passwd \" incompatible " "with auth method %d", li->li_acl_authmethod ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } if ( !BER_BVISNULL( &li->li_acl_passwd ) ) { @@ -1558,11 +1558,11 @@ done_url:; break; default: - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-authcDN \" incompatible " "with auth method %d", li->li_idassert_authmethod ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } if ( !BER_BVISNULL( &li->li_idassert_authcDN ) ) { @@ -1584,11 +1584,11 @@ done_url:; break; default: - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-passwd \" incompatible " "with auth method %d", li->li_idassert_authmethod ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } if ( !BER_BVISNULL( &li->li_idassert_passwd ) ) { @@ -1603,10 +1603,10 @@ done_url:; case LDAP_BACK_CFG_IDASSERT_METHOD: /* no longer supported */ - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"idassert-method \": " "no longer supported; use \"idassert-bind\"" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; case LDAP_BACK_CFG_IDASSERT_BIND: @@ -1649,10 +1649,10 @@ done_url:; int rc; if ( li->li_uri == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "need URI to discover absolute filters support " "in \"t-f-support discover\"" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -1691,10 +1691,10 @@ done_url:; unsigned u; if ( lutil_atoux( &u, c->argv[ i ], 0 ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to parse timeout \"%s\"", c->argv[ i ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -1706,10 +1706,10 @@ done_url:; } if ( slap_cf_aux_table_parse( c->argv[ i ], li->li_timeout, timeout_table, "slapd-ldap timeout" ) ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to parse timeout \"%s\"", c->argv[ i ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } } @@ -1719,10 +1719,10 @@ done_url:; unsigned long t; if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to parse idle timeout \"%s\"", c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } li->li_idle_timeout = (time_t)t; @@ -1732,10 +1732,10 @@ done_url:; unsigned long t; if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to parse conn ttl\"%s\"", c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } li->li_conn_ttl = (time_t)t; @@ -1745,10 +1745,10 @@ done_url:; unsigned long t; if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "unable to parse network timeout \"%s\"", c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } li->li_network_timeout = (time_t)t; @@ -1756,11 +1756,11 @@ done_url:; case LDAP_BACK_CFG_VERSION: if ( c->value_int != 0 && ( c->value_int < LDAP_VERSION_MIN || c->value_int > LDAP_VERSION_MAX ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unsupported version \"%s\" " "in \"protocol-version \"", c->argv[ 1 ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -1789,7 +1789,7 @@ done_url:; if ( c->value_int < LDAP_BACK_CONN_PRIV_MIN || c->value_int > LDAP_BACK_CONN_PRIV_MAX ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "invalid max size " "of privileged " "connections pool \"%s\" " "in \"conn-pool-max " @@ -1797,7 +1797,7 @@ done_url:; c->argv[ 1 ], LDAP_BACK_CONN_PRIV_MIN, LDAP_BACK_CONN_PRIV_MAX ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } li->li_conn_priv_max = c->value_int; @@ -1821,10 +1821,10 @@ done_url:; int rc; if ( li->li_uri == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "need URI to discover \"cancel\" support " "in \"cancel exop-discover\"" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } @@ -1847,15 +1847,15 @@ done_url:; case LDAP_BACK_CFG_QUARANTINE: if ( LDAP_BACK_QUARANTINE( li ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "quarantine already defined" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } rc = slap_retry_info_parse( c->argv[1], &li->li_quarantine, - c->msg, sizeof( c->msg ) ); + c->cr_msg, sizeof( c->cr_msg ) ); if ( rc ) { - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); } else { ldap_pvt_thread_mutex_init( &li->li_quarantine_mutex ); @@ -1867,12 +1867,12 @@ done_url:; break; case LDAP_BACK_CFG_REWRITE: - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "rewrite/remap capabilities have been moved " "to the \"rwm\" overlay; see slapo-rwm(5) " "for details (hint: add \"overlay rwm\" " "and prefix all directives with \"rwm-\")" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; default: diff --git a/servers/slapd/back-ldap/distproc.c b/servers/slapd/back-ldap/distproc.c index 800abf7f11..42424683ed 100644 --- a/servers/slapd/back-ldap/distproc.c +++ b/servers/slapd/back-ldap/distproc.c @@ -472,9 +472,9 @@ ldap_distproc_cfadd_apply( void *datum, void *arg ) struct berval bv; /* FIXME: should not hardcode "olcDatabase" here */ - bv.bv_len = snprintf( lca->ca->msg, sizeof( lca->ca->msg ), + bv.bv_len = snprintf( lca->ca->cr_msg, sizeof( lca->ca->cr_msg ), "olcDatabase={%d}%s", lca->count, lback->bi_type ); - bv.bv_val = lca->ca->msg; + bv.bv_val = lca->ca->cr_msg; lca->ca->be->be_private = (void *)li; config_build_entry( lca->op, lca->rs, lca->p->e_private, lca->ca, @@ -568,7 +568,7 @@ distproc_cfgen( ConfigArgs *c ) static int ldap_distproc_db_init( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; ldap_distproc_t *lc = NULL; @@ -761,7 +761,7 @@ ldap_distproc_db_func( static int ldap_distproc_db_open( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { return ldap_distproc_db_func( be, db_open ); } @@ -769,7 +769,7 @@ ldap_distproc_db_open( static int ldap_distproc_db_close( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { return ldap_distproc_db_func( be, db_close ); } @@ -777,7 +777,7 @@ ldap_distproc_db_close( static int ldap_distproc_db_destroy( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; ldap_distproc_t *lc = (ldap_distproc_t *)on->on_bi.bi_private; diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index 4d554c204d..32b07b2f8c 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -99,7 +99,7 @@ ldap_back_initialize( BackendInfo *bi ) } int -ldap_back_db_init( Backend *be, ConfigArgs *ca ) +ldap_back_db_init( Backend *be, ConfigReply *cr ) { ldapinfo_t *li; int rc; @@ -169,7 +169,7 @@ ldap_back_db_init( Backend *be, ConfigArgs *ca ) } int -ldap_back_db_open( BackendDB *be, ConfigArgs *ca ) +ldap_back_db_open( BackendDB *be, ConfigReply *cr ) { ldapinfo_t *li = (ldapinfo_t *)be->be_private; @@ -256,7 +256,7 @@ ldap_back_conn_free( void *v_lc ) } int -ldap_back_db_close( Backend *be, ConfigArgs *ca ) +ldap_back_db_close( Backend *be, ConfigReply *cr ) { int rc = 0; @@ -268,7 +268,7 @@ ldap_back_db_close( Backend *be, ConfigArgs *ca ) } int -ldap_back_db_destroy( Backend *be, ConfigArgs *ca ) +ldap_back_db_destroy( Backend *be, ConfigReply *cr ) { if ( be->be_private ) { ldapinfo_t *li = ( ldapinfo_t * )be->be_private; diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 5d1676b212..03f50f5a2f 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -1214,7 +1214,7 @@ static ID ldif_tool_entry_put(BackendDB * be, Entry * e, struct berval *text) { } static int -ldif_back_db_init( BackendDB *be, ConfigArgs *ca ) +ldif_back_db_init( BackendDB *be, ConfigReply *cr ) { struct ldif_info *ni; @@ -1226,7 +1226,7 @@ ldif_back_db_init( BackendDB *be, ConfigArgs *ca ) } static int -ldif_back_db_destroy( Backend *be, ConfigArgs *ca ) +ldif_back_db_destroy( Backend *be, ConfigReply *cr ) { struct ldif_info *ni = be->be_private; @@ -1237,7 +1237,7 @@ ldif_back_db_destroy( Backend *be, ConfigArgs *ca ) } static int -ldif_back_db_open( Backend *be, ConfigArgs *ca) +ldif_back_db_open( Backend *be, ConfigReply *cr) { struct ldif_info *ni = (struct ldif_info *) be->be_private; if( BER_BVISEMPTY(&ni->li_base_path)) {/* missing base path */ diff --git a/servers/slapd/back-meta/init.c b/servers/slapd/back-meta/init.c index 9edf6aeddf..a530d7cd89 100644 --- a/servers/slapd/back-meta/init.c +++ b/servers/slapd/back-meta/init.c @@ -89,7 +89,7 @@ meta_back_initialize( int meta_back_db_init( Backend *be, - ConfigArgs *ca) + ConfigReply *cr) { metainfo_t *mi; int i; @@ -131,7 +131,7 @@ meta_back_db_init( int meta_back_db_open( Backend *be, - ConfigArgs *ca ) + ConfigReply *cr ) { metainfo_t *mi = (metainfo_t *)be->be_private; @@ -332,7 +332,7 @@ target_free( int meta_back_db_destroy( Backend *be, - ConfigArgs *ca ) + ConfigReply *cr ) { metainfo_t *mi; diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 22f02e3a04..951a28631f 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -2051,7 +2051,7 @@ monitor_back_initialize( int monitor_back_db_init( BackendDB *be, - ConfigArgs *c) + ConfigReply *c) { int rc; struct berval dn = BER_BVC( SLAPD_MONITOR_DN ), @@ -2125,7 +2125,7 @@ monitor_back_db_init( int monitor_back_db_open( BackendDB *be, - ConfigArgs *ca) + ConfigReply *cr) { monitor_info_t *mi = (monitor_info_t *)be->be_private; struct monitor_subsys_t **ms; @@ -2465,7 +2465,7 @@ monitor_back_db_config( int monitor_back_db_destroy( BackendDB *be, - ConfigArgs *ca) + ConfigReply *cr) { monitor_info_t *mi = ( monitor_info_t * )be->be_private; diff --git a/servers/slapd/back-null/null.c b/servers/slapd/back-null/null.c index d6fb41d256..29673f9a42 100644 --- a/servers/slapd/back-null/null.c +++ b/servers/slapd/back-null/null.c @@ -161,7 +161,7 @@ null_back_db_config( } static int -null_back_db_init( BackendDB *be, ConfigArgs *ca ) +null_back_db_init( BackendDB *be, ConfigReply *cr ) { struct null_info *ni = ch_calloc( 1, sizeof(struct null_info) ); ni->ni_bind_allowed = 0; @@ -171,7 +171,7 @@ null_back_db_init( BackendDB *be, ConfigArgs *ca ) } static int -null_back_db_destroy( Backend *be, ConfigArgs *ca ) +null_back_db_destroy( Backend *be, ConfigReply *cr ) { free( be->be_private ); return 0; diff --git a/servers/slapd/back-perl/close.c b/servers/slapd/back-perl/close.c index 5e66d053a7..c2c47d118c 100644 --- a/servers/slapd/back-perl/close.c +++ b/servers/slapd/back-perl/close.c @@ -40,7 +40,7 @@ perl_back_close( int perl_back_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { free( be->be_private ); diff --git a/servers/slapd/back-perl/init.c b/servers/slapd/back-perl/init.c index edaf5f1a22..c40ecb50d0 100644 --- a/servers/slapd/back-perl/init.c +++ b/servers/slapd/back-perl/init.c @@ -87,7 +87,7 @@ perl_back_initialize( int perl_back_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { be->be_private = (PerlBackend *) ch_malloc( sizeof(PerlBackend) ); @@ -103,7 +103,7 @@ perl_back_db_init( int perl_back_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { int count; diff --git a/servers/slapd/back-relay/init.c b/servers/slapd/back-relay/init.c index ca20602b25..fa4af71085 100644 --- a/servers/slapd/back-relay/init.c +++ b/servers/slapd/back-relay/init.c @@ -70,7 +70,7 @@ relay_back_initialize( BackendInfo *bi ) } int -relay_back_db_init( Backend *be, ConfigArgs *ca) +relay_back_db_init( Backend *be, ConfigReply *cr) { relay_back_info *ri; @@ -91,7 +91,7 @@ relay_back_db_init( Backend *be, ConfigArgs *ca) } int -relay_back_db_open( Backend *be, ConfigArgs *ca ) +relay_back_db_open( Backend *be, ConfigReply *cr ) { relay_back_info *ri = (relay_back_info *)be->be_private; @@ -115,13 +115,13 @@ relay_back_db_open( Backend *be, ConfigArgs *ca ) } int -relay_back_db_close( Backend *be, ConfigArgs *ca ) +relay_back_db_close( Backend *be, ConfigReply *cr ) { return 0; } int -relay_back_db_destroy( Backend *be, ConfigArgs *ca) +relay_back_db_destroy( Backend *be, ConfigReply *cr) { relay_back_info *ri = (relay_back_info *)be->be_private; diff --git a/servers/slapd/back-shell/init.c b/servers/slapd/back-shell/init.c index 68e11712a2..db9a91d2c8 100644 --- a/servers/slapd/back-shell/init.c +++ b/servers/slapd/back-shell/init.c @@ -79,7 +79,7 @@ shell_back_initialize( int shell_back_db_init( Backend *be, - ConfigArgs *ca + ConfigReply *cr ) { struct shellinfo *si; @@ -94,7 +94,7 @@ shell_back_db_init( int shell_back_db_destroy( Backend *be, - ConfigArgs *ca + ConfigReply *cr ) { free( be->be_private ); diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c index 7950dbea18..c317d3cb70 100644 --- a/servers/slapd/back-sql/init.c +++ b/servers/slapd/back-sql/init.c @@ -95,7 +95,7 @@ backsql_destroy( int backsql_db_init( BackendDB *bd, - ConfigArgs *ca ) + ConfigReply *cr ) { backsql_info *bi; int rc = 0; @@ -120,7 +120,7 @@ backsql_db_init( int backsql_db_destroy( BackendDB *bd, - ConfigArgs *ca ) + ConfigReply *cr ) { backsql_info *bi = (backsql_info*)bd->be_private; @@ -221,7 +221,7 @@ backsql_db_destroy( int backsql_db_open( BackendDB *bd, - ConfigArgs *ca ) + ConfigReply *cr ) { backsql_info *bi = (backsql_info*)bd->be_private; SQLHDBC dbh = SQL_NULL_HDBC; @@ -570,7 +570,7 @@ backsql_db_open( int backsql_db_close( BackendDB *bd, - ConfigArgs *ca ) + ConfigReply *cr ) { backsql_info *bi = (backsql_info*)bd->be_private; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 28c5fabd0e..f1d49e2c07 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -190,7 +190,7 @@ backend_set_controls( BackendDB *be ) } /* startup a specific backend database */ -int backend_startup_one(Backend *be, ConfigArgs *ca) +int backend_startup_one(Backend *be, ConfigReply *cr) { int rc = 0; @@ -210,7 +210,7 @@ int backend_startup_one(Backend *be, ConfigArgs *ca) (void)backend_set_controls( be ); if ( be->bd_info->bi_db_open ) { - rc = be->bd_info->bi_db_open( be, ca ); + rc = be->bd_info->bi_db_open( be, cr ); if ( rc == 0 ) { (void)backend_set_controls( be ); @@ -229,6 +229,7 @@ int backend_startup(Backend *be) int i; int rc = 0; BackendInfo *bi; + ConfigReply cr={0, ""}; if( ! ( nBackendDB > 0 ) ) { /* no databases */ @@ -252,7 +253,7 @@ int backend_startup(Backend *be) /* append global access controls */ acl_append( &be->be_acl, frontendDB->be_acl, -1 ); - return backend_startup_one( be, NULL ); + return backend_startup_one( be, &cr ); } /* open frontend, if required */ @@ -301,7 +302,7 @@ int backend_startup(Backend *be) /* append global access controls */ acl_append( &be->be_acl, frontendDB->be_acl, -1 ); - rc = backend_startup_one( be, NULL ); + rc = backend_startup_one( be, &cr ); if ( rc ) return rc; } @@ -549,7 +550,7 @@ backend_db_init( const char *type, BackendDB *b0, int idx, - ConfigArgs *ca) + ConfigReply *cr) { BackendInfo *bi = backend_info(type); BackendDB *be = b0; @@ -588,7 +589,7 @@ backend_db_init( be->be_max_deref_depth = SLAPD_DEFAULT_MAXDEREFDEPTH; if ( bi->bi_db_init ) { - rc = bi->bi_db_init( be, ca ); + rc = bi->bi_db_init( be, cr ); } if ( rc != 0 ) { diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 975065a426..129d4db4b0 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -818,7 +818,7 @@ glue_tool_sync ( static int glue_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -874,7 +874,7 @@ glue_db_init( static int glue_db_destroy ( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -887,7 +887,7 @@ glue_db_destroy ( static int glue_db_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 53b8cd980b..874ccf065a 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -169,7 +169,7 @@ over_db_config( static int over_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { return over_db_func( be, db_open ); @@ -178,7 +178,7 @@ over_db_open( static int over_db_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinfo *oi = be->bd_info->bi_private; @@ -205,7 +205,7 @@ over_db_close( static int over_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinfo *oi = be->bd_info->bi_private; diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index d95a38152e..61d44b6758 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1220,9 +1220,9 @@ config_generic(ConfigArgs *c) { switch(c->type) { case CFG_BACKEND: if(!(c->bi = backend_info(c->argv[1]))) { - snprintf( c->msg, sizeof( c->msg ), "<%s> failed init", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> failed init", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return(1); } break; @@ -1236,11 +1236,11 @@ config_generic(ConfigArgs *c) { } else if ( !strcasecmp( c->argv[1], "frontend" )) { c->be = frontendDB; } else { - c->be = backend_db_init(c->argv[1], NULL, c->valx, c); + c->be = backend_db_init(c->argv[1], NULL, c->valx, &c->reply); if ( !c->be ) { - if ( c->msg[0] == 0 ) - snprintf( c->msg, sizeof( c->msg ), "<%s> failed init", c->argv[0] ); - Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", c->log, c->msg, c->argv[1] ); + if ( c->cr_msg[0] == 0 ) + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> failed init", c->argv[0] ); + Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", c->log, c->cr_msg, c->argv[1] ); return(1); } } @@ -1252,19 +1252,19 @@ config_generic(ConfigArgs *c) { case CFG_THREADS: if ( c->value_int < 2 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "threads=%d smaller than minimum value 2", c->value_int ); Debug(LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } else if ( c->value_int > 2 * SLAP_MAX_WORKER_THREADS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "warning, threads=%d larger than twice the default (2*%d=%d); YMMV", c->value_int, SLAP_MAX_WORKER_THREADS, 2 * SLAP_MAX_WORKER_THREADS ); Debug(LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); } if ( slapMode & SLAP_SERVER_MODE ) ldap_pvt_thread_pool_maxthreads(&connection_pool, c->value_int); @@ -1298,9 +1298,9 @@ config_generic(ConfigArgs *c) { case CFG_AZPOLICY: ch_free(c->value_string); if (slap_sasl_setpolicy( c->argv[1] )) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse value", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse value", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return(1); } break; @@ -1315,9 +1315,9 @@ config_generic(ConfigArgs *c) { { char *txt = slap_sasl_secprops( c->argv[1] ); if ( txt ) { - snprintf( c->msg, sizeof(c->msg), "<%s> %s", + snprintf( c->cr_msg, sizeof(c->cr_msg), "<%s> %s", c->argv[0], txt ); - Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); + Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg, 0 ); return(1); } break; @@ -1439,9 +1439,9 @@ config_generic(ConfigArgs *c) { case CFG_ROOTDSE: if(root_dse_read_file(c->argv[1])) { - snprintf( c->msg, sizeof( c->msg ), "<%s> could not read file", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> could not read file", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return(1); } { @@ -1459,10 +1459,10 @@ config_generic(ConfigArgs *c) { LDAPURLDesc *lud; int num = atoi( c->argv[1] ); if ( num < 0 || num > SLAP_SYNC_SID_MAX ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> illegal server ID", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return 1; } /* only one value allowed if no URL is given */ @@ -1470,18 +1470,18 @@ config_generic(ConfigArgs *c) { int len; if ( sid_list && BER_BVISEMPTY( &sid_list->si_url )) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> only one server ID allowed now", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return 1; } if ( ldap_url_parse( c->argv[2], &lud )) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid URL", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[2] ); + c->log, c->cr_msg, c->argv[2] ); return 1; } len = strlen( c->argv[2] ); @@ -1491,10 +1491,10 @@ config_generic(ConfigArgs *c) { strcpy( si->si_url.bv_val, c->argv[2] ); } else { if ( sid_list ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unqualified server ID not allowed now", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return 1; } si = ch_malloc( sizeof(ServerID) ); @@ -1569,10 +1569,10 @@ config_generic(ConfigArgs *c) { case CFG_LASTMOD: if(SLAP_NOLASTMODCMD(c->be)) { - snprintf( c->msg, sizeof( c->msg ), "<%s> not available for %s database", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> not available for %s database", c->argv[0], c->be->bd_info->bi_type ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return(1); } if(c->value_int) @@ -1583,10 +1583,10 @@ config_generic(ConfigArgs *c) { case CFG_MIRRORMODE: if(!SLAP_SHADOW(c->be)) { - snprintf( c->msg, sizeof( c->msg ), "<%s> database is not a shadow", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> database is not a shadow", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return(1); } if(c->value_int) @@ -1611,9 +1611,9 @@ config_generic(ConfigArgs *c) { case CFG_SSTR_IF_MAX: if (c->value_int < index_substr_if_minlen) { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid value", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%d)\n", - c->log, c->msg, c->value_int ); + c->log, c->cr_msg, c->value_int ); return(1); } index_substr_if_maxlen = c->value_int; @@ -1621,9 +1621,9 @@ config_generic(ConfigArgs *c) { case CFG_SSTR_IF_MIN: if (c->value_int > index_substr_if_maxlen) { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid value", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%d)\n", - c->log, c->msg, c->value_int ); + c->log, c->cr_msg, c->value_int ); return(1); } index_substr_if_minlen = c->value_int; @@ -1638,10 +1638,10 @@ config_generic(ConfigArgs *c) { modcur = c->private; /* This should never fail */ if ( module_path( modcur->mp_path.bv_val )) { - snprintf( c->msg, sizeof( c->msg ), "<%s> module path no longer valid", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> module path no longer valid", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", - c->log, c->msg, modcur->mp_path.bv_val ); + c->log, c->cr_msg, modcur->mp_path.bv_val ); return(1); } } @@ -1829,16 +1829,16 @@ config_passwd_hash(ConfigArgs *c) { } for(i = 1; i < c->argc; i++) { if(!lutil_passwd_scheme(c->argv[i])) { - snprintf( c->msg, sizeof( c->msg ), "<%s> scheme not available", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> scheme not available", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); } else { ldap_charray_add(&default_passwd_hash, c->argv[i]); } if(!default_passwd_hash) { - snprintf( c->msg, sizeof( c->msg ), "<%s> no valid hashes found", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> no valid hashes found", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return(1); } } @@ -1898,9 +1898,9 @@ config_sizelimit(ConfigArgs *c) { if(!strncasecmp(c->argv[i], "size", 4)) { rc = limits_parse_one(c->argv[i], lim); if ( rc ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse value", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse value", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } } else { @@ -1908,9 +1908,9 @@ config_sizelimit(ConfigArgs *c) { lim->lms_s_soft = -1; } else { if ( lutil_atoix( &lim->lms_s_soft, c->argv[i], 0 ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse limit", c->argv[0]); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse limit", c->argv[0]); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } } @@ -1945,9 +1945,9 @@ config_timelimit(ConfigArgs *c) { if(!strncasecmp(c->argv[i], "time", 4)) { rc = limits_parse_one(c->argv[i], lim); if ( rc ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse value", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse value", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } } else { @@ -1955,9 +1955,9 @@ config_timelimit(ConfigArgs *c) { lim->lms_t_soft = -1; } else { if ( lutil_atoix( &lim->lms_t_soft, c->argv[i], 0 ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse limit", c->argv[0]); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse limit", c->argv[0]); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } } @@ -2105,10 +2105,10 @@ config_suffix(ConfigArgs *c) #ifdef SLAPD_MONITOR_DN if(!strcasecmp(c->argv[1], SLAPD_MONITOR_DN)) { - snprintf( c->msg, sizeof( c->msg ), "<%s> DN is reserved for monitoring slapd", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> DN is reserved for monitoring slapd", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", - c->log, c->msg, SLAPD_MONITOR_DN); + c->log, c->cr_msg, SLAPD_MONITOR_DN); return(1); } #endif @@ -2139,11 +2139,11 @@ config_suffix(ConfigArgs *c) type = oi->oi_orig->bi_type; } - snprintf( c->msg, sizeof( c->msg ), "<%s> namingContext \"%s\" " + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> namingContext \"%s\" " "already served by a preceding %s database", c->argv[0], pdn.bv_val, type ); Debug(LDAP_DEBUG_ANY, "%s: %s serving namingContext \"%s\"\n", - c->log, c->msg, tbe->be_suffix[0].bv_val); + c->log, c->cr_msg, tbe->be_suffix[0].bv_val); free(pdn.bv_val); free(ndn.bv_val); return(1); @@ -2205,10 +2205,10 @@ config_rootpw(ConfigArgs *c) { tbe = select_backend(&c->be->be_rootndn, 0); if(tbe != c->be) { - snprintf( c->msg, sizeof( c->msg ), "<%s> can only be set when rootdn is under suffix", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> can only be set when rootdn is under suffix", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(1); } if ( !BER_BVISNULL( &c->be->be_rootpw )) @@ -2255,9 +2255,9 @@ config_restrict(ConfigArgs *c) { } i = verbs_to_mask( c->argc, c->argv, restrictable_ops, &restrictops ); if ( i ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unknown operation", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unknown operation", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } if ( restrictops & SLAP_RESTRICT_OP_EXTENDED ) @@ -2291,9 +2291,9 @@ config_allows(ConfigArgs *c) { } i = verbs_to_mask(c->argc, c->argv, allowable_ops, &allows); if ( i ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unknown feature", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unknown feature", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } global_allows |= allows; @@ -2324,9 +2324,9 @@ config_disallows(ConfigArgs *c) { } i = verbs_to_mask(c->argc, c->argv, disallowable_ops, &disallows); if ( i ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unknown feature", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unknown feature", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } global_disallows |= disallows; @@ -2367,13 +2367,13 @@ config_requires(ConfigArgs *c) { i = verbs_to_mask(argc, argv, requires_ops, &requires); if ( i ) { if (strcasecmp( c->argv[ i ], "none" ) == 0 ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> \"none\" (#%d) must be listed first", c->argv[0], i - 1 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> \"none\" (#%d) must be listed first", c->argv[0], i - 1 ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); } else { - snprintf( c->msg, sizeof( c->msg ), "<%s> unknown feature #%d", c->argv[0], i - 1 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unknown feature #%d", c->argv[0], i - 1 ); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); } return(1); } @@ -2584,16 +2584,16 @@ config_loglevel(ConfigArgs *c) { if ( isdigit((unsigned char)c->argv[i][0]) || c->argv[i][0] == '-' ) { if( lutil_atoi( &level, c->argv[i] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse level", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse level", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return( 1 ); } } else { if ( str2loglevel( c->argv[i], &level ) ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unknown level", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unknown level", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return( 1 ); } } @@ -2632,9 +2632,9 @@ config_referral(ConfigArgs *c) { return 0; } if(validate_global_referral(c->argv[1])) { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid URL", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid URL", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", - c->log, c->msg, c->argv[1]); + c->log, c->cr_msg, c->argv[1]); return(1); } @@ -2702,16 +2702,16 @@ config_security(ConfigArgs *c) { } } if ( !tgt ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unknown factor", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unknown factor", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s %s\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } if ( lutil_atou( tgt, src ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> unable to parse factor", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse factor", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->argv[i]); + c->log, c->cr_msg, c->argv[i]); return(1); } } @@ -2750,9 +2750,9 @@ config_updatedn(ConfigArgs *c) { return 0; } if(SLAP_SHADOW(c->be)) { - snprintf( c->msg, sizeof( c->msg ), "<%s> database already shadowed", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> database already shadowed", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(1); } @@ -2812,17 +2812,17 @@ config_updateref(ConfigArgs *c) { return 0; } if(!SLAP_SHADOW(c->be) && !c->be->be_syncinfo) { - snprintf( c->msg, sizeof( c->msg ), "<%s> must appear after syncrepl or updatedn", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> must appear after syncrepl or updatedn", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(1); } if(validate_global_referral(c->argv[1])) { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid URL", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid URL", c->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n", - c->log, c->msg, c->argv[1]); + c->log, c->cr_msg, c->argv[1]); return(1); } ber_str2bv(c->argv[1], 0, 0, &val); @@ -2835,9 +2835,9 @@ config_obsolete(ConfigArgs *c) { if (c->op == SLAP_CONFIG_EMIT) return 1; - snprintf( c->msg, sizeof( c->msg ), "<%s> keyword is obsolete (ignored)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> keyword is obsolete (ignored)", c->argv[0] ); - Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0); + Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg, 0); return(0); } @@ -3049,7 +3049,7 @@ ok: rs->sr_err = config_add_internal( sc->cfb, rs->sr_entry, sc->ca, NULL, NULL, NULL ); if ( rs->sr_err != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, "config error processing %s: %s\n", - rs->sr_entry->e_name.bv_val, sc->ca->msg, 0 ); + rs->sr_entry->e_name.bv_val, sc->ca->cr_msg, 0 ); } } return rs->sr_err; @@ -3106,7 +3106,8 @@ config_setup_ldif( BackendDB *be, const char *dir, int readit ) { argv[1] = (char *)dir; argv[2] = NULL; c.argv = argv; - c.msg[0] = '\0'; + c.reply.err = 0; + c.reply.msg[0] = 0; c.table = Cft_Database; ct = config_find_keyword( c.be->be_cf_ocs->co_table, &c ); @@ -3116,7 +3117,7 @@ config_setup_ldif( BackendDB *be, const char *dir, int readit ) { if ( config_add_vals( ct, &c )) return 1; - if ( backend_startup_one( &cfb->cb_db, &c )) + if ( backend_startup_one( &cfb->cb_db, &c.reply )) return 1; if ( readit ) { @@ -3439,7 +3440,7 @@ check_vals( ConfigTable *ct, ConfigArgs *ca, void *ptr, int isAttr ) if ( a && ( ad->ad_type->sat_flags & SLAP_AT_ORDERED_VAL )) { rc = ordered_value_sort( a, 1 ); if ( rc ) { - snprintf(ca->msg, sizeof( ca->msg ), "ordered_value_sort failed on attr %s\n", + snprintf(ca->cr_msg, sizeof( ca->cr_msg ), "ordered_value_sort failed on attr %s\n", ad->ad_cname.bv_val ); return rc; } @@ -4098,7 +4099,7 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, if ( renum && *renum && coptr->co_type != Cft_Database && coptr->co_type != Cft_Overlay ) { - snprintf( ca->msg, sizeof( ca->msg ), + snprintf( ca->cr_msg, sizeof( ca->cr_msg ), "operation requires sibling renumbering" ); rc = LDAP_UNWILLING_TO_PERFORM; goto done_noop; @@ -4153,22 +4154,22 @@ ok: /* Newly added databases and overlays need to be started up */ if ( CONFIG_ONLINE_ADD( ca )) { if ( colst[0]->co_type == Cft_Database ) { - rc = backend_startup_one( ca->be, ca ); + rc = backend_startup_one( ca->be, &ca->reply ); } else if ( colst[0]->co_type == Cft_Overlay ) { if ( ca->bi->bi_db_open ) { BackendInfo *bi_orig = ca->be->bd_info; ca->be->bd_info = ca->bi; - rc = ca->bi->bi_db_open( ca->be, ca ); + rc = ca->bi->bi_db_open( ca->be, &ca->reply ); ca->be->bd_info = bi_orig; } } if ( rc ) { - if (ca->msg[0] == '\0') - snprintf( ca->msg, sizeof( ca->msg ), "<%s> failed startup", ca->argv[0] ); + if (ca->cr_msg[0] == '\0') + snprintf( ca->cr_msg, sizeof( ca->cr_msg ), "<%s> failed startup", ca->argv[0] ); Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - ca->log, ca->msg, ca->argv[1] ); + ca->log, ca->cr_msg, ca->argv[1] ); rc = LDAP_OTHER; goto done; } @@ -4356,7 +4357,7 @@ config_back_add( Operation *op, SlapReply *rs ) */ rs->sr_err = config_add_internal( cfb, op->ora_e, &ca, rs, &renumber, op ); if ( rs->sr_err != LDAP_SUCCESS ) { - rs->sr_text = ca.msg; + rs->sr_text = ca.cr_msg; goto out2; } @@ -4480,7 +4481,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, int *idx = NULL; if ( ct && ( ct->arg_type & ARG_NO_DELETE )) { rc = LDAP_OTHER; - snprintf(ca->msg, sizeof(ca->msg), "cannot delete %s", + snprintf(ca->cr_msg, sizeof(ca->cr_msg), "cannot delete %s", ml->sml_desc->ad_cname.bv_val ); goto out_noop; } @@ -4509,7 +4510,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, } rc = modify_delete_vindex(e, &ml->sml_mod, get_permissiveModify(op), - &rs->sr_text, ca->msg, sizeof(ca->msg), idx ); + &rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg), idx ); if ( ml->sml_op == LDAP_MOD_REPLACE ) { ml->sml_values = vals; ml->sml_nvalues = nvals; @@ -4542,7 +4543,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, j = strtol( val, &next, 0 ); if ( next == val || next[ 0 ] != '}' || j < navals ) { rc = LDAP_OTHER; - snprintf(ca->msg, sizeof(ca->msg), "cannot insert %s", + snprintf(ca->cr_msg, sizeof(ca->cr_msg), "cannot insert %s", ml->sml_desc->ad_cname.bv_val ); goto out_noop; } @@ -4553,7 +4554,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, } rc = modify_add_values(e, &ml->sml_mod, get_permissiveModify(op), - &rs->sr_text, ca->msg, sizeof(ca->msg) ); + &rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg) ); /* If value already exists, show success here * and ignore this operation down below. @@ -4580,7 +4581,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, if ( rc == LDAP_SUCCESS) { /* check that the entry still obeys the schema */ rc = entry_schema_check(op, e, NULL, 0, 0, - &rs->sr_text, ca->msg, sizeof(ca->msg) ); + &rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg) ); if ( rc ) goto out_noop; } /* Basic syntax checks are OK. Do the actual settings. */ @@ -4787,7 +4788,7 @@ config_back_modify( Operation *op, SlapReply *rs ) */ rs->sr_err = config_modify_internal( ce, op, rs, &ca ); if ( rs->sr_err ) { - rs->sr_text = ca.msg; + rs->sr_text = ca.cr_msg; } else if ( cfb->cb_use_ldif ) { BackendDB *be = op->o_bd; slap_callback sc = { NULL, slap_null_cb, NULL, NULL }, *scp; @@ -5209,8 +5210,8 @@ config_build_entry( Operation *op, SlapReply *rs, CfEntryInfo *parent, } oc_at = attr_find( e->e_attrs, slap_schema.si_ad_objectClass ); - rc = structural_class(oc_at->a_vals, &oc, NULL, &text, c->msg, - sizeof(c->msg), op ? op->o_tmpmemctx : NULL ); + rc = structural_class(oc_at->a_vals, &oc, NULL, &text, c->cr_msg, + sizeof(c->cr_msg), op ? op->o_tmpmemctx : NULL ); attr_merge_normalize_one(e, slap_schema.si_ad_structuralObjectClass, &oc->soc_cname, NULL ); if ( op && !op->o_noop ) { op->ora_e = e; @@ -5391,7 +5392,7 @@ static const char *defacl[] = { }; static int -config_back_db_open( BackendDB *be, ConfigArgs *ca ) +config_back_db_open( BackendDB *be, ConfigReply *cr ) { CfBackInfo *cfb = be->be_private; struct berval rdn; @@ -5629,7 +5630,7 @@ cfb_free_entries( CfEntryInfo *ce ) } static int -config_back_db_close( BackendDB *be, ConfigArgs *ca ) +config_back_db_close( BackendDB *be, ConfigReply *cr ) { CfBackInfo *cfb = be->be_private; @@ -5644,7 +5645,7 @@ config_back_db_close( BackendDB *be, ConfigArgs *ca ) } static int -config_back_db_destroy( BackendDB *be, ConfigArgs *ca ) +config_back_db_destroy( BackendDB *be, ConfigReply *cr ) { CfBackInfo *cfb = be->be_private; @@ -5669,7 +5670,7 @@ config_back_db_destroy( BackendDB *be, ConfigArgs *ca ) } static int -config_back_db_init( BackendDB *be, ConfigArgs* ca ) +config_back_db_init( BackendDB *be, ConfigReply* cr ) { struct berval dn; CfBackInfo *cfb; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 2d475d2006..b99d8f0a19 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -141,54 +141,54 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { c->argv[1] = ""; } if(Conf->min_args && (c->argc < Conf->min_args)) { - snprintf( c->msg, sizeof( c->msg ), "<%s> missing <%s> argument", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> missing <%s> argument", c->argv[0], Conf->what ); - Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: keyword %s\n", c->log, c->msg, 0 ); + Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: keyword %s\n", c->log, c->cr_msg, 0 ); return(ARG_BAD_CONF); } if(Conf->max_args && (c->argc > Conf->max_args)) { char *ignored = " ignored"; - snprintf( c->msg, sizeof( c->msg ), "<%s> extra cruft after <%s>", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> extra cruft after <%s>", c->argv[0], Conf->what ); ignored = ""; Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s%s.\n", - c->log, c->msg, ignored ); + c->log, c->cr_msg, ignored ); return(ARG_BAD_CONF); } if((arg_syn & ARG_DB) && !c->be) { - snprintf( c->msg, sizeof( c->msg ), "<%s> only allowed within database declaration", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> only allowed within database declaration", c->argv[0] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: keyword %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } if((arg_syn & ARG_PRE_BI) && c->bi) { - snprintf( c->msg, sizeof( c->msg ), "<%s> must occur before any backend %sdeclaration", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> must occur before any backend %sdeclaration", c->argv[0], (arg_syn & ARG_PRE_DB) ? "or database " : "" ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: keyword %s\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return(ARG_BAD_CONF); } if((arg_syn & ARG_PRE_DB) && c->be && c->be != frontendDB) { - snprintf( c->msg, sizeof( c->msg ), "<%s> must occur before any database declaration", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> must occur before any database declaration", c->argv[0] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: keyword %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } if((arg_syn & ARG_PAREN) && *c->argv[1] != '(' /*')'*/) { - snprintf( c->msg, sizeof( c->msg ), "<%s> old format not supported", c->argv[0] ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> old format not supported", c->argv[0] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } if(arg_type && !Conf->arg_item && !(arg_syn & ARG_OFFSET)) { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid config_table, arg_item is NULL", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid config_table, arg_item is NULL", c->argv[0] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } c->type = arg_user; @@ -204,9 +204,9 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { ber_str2bv( c->argv[1], 0, 0, &bv ); rc = dnPrettyNormal( NULL, &bv, &c->value_dn, &c->value_ndn, NULL ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid DN %d (%s)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid DN %d (%s)", c->argv[0], rc, ldap_err2string( rc )); - Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n" , c->log, c->msg, 0); + Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n" , c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } if ( check_only ) { @@ -219,32 +219,32 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { switch(arg_type) { case ARG_INT: if ( lutil_atoix( &iarg, c->argv[1], 0 ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse \"%s\" as int", c->argv[0], c->argv[1] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } break; case ARG_LONG: if ( lutil_atolx( &larg, c->argv[1], 0 ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse \"%s\" as long", c->argv[0], c->argv[1] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } break; case ARG_BER_LEN_T: { unsigned long l; if ( lutil_atoulx( &l, c->argv[1], 0 ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> unable to parse \"%s\" as ber_len_t", c->argv[0], c->argv[1] ); Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } barg = (ber_len_t)l; @@ -263,10 +263,10 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { { iarg = 0; } else { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid value", c->argv[0] ); Debug(LDAP_DEBUG_ANY|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return(ARG_BAD_CONF); } break; @@ -274,10 +274,10 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { j = (arg_type & ARG_NONZERO) ? 1 : 0; if(iarg < j && larg < j && barg < j ) { larg = larg ? larg : (barg ? barg : iarg); - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid value", c->argv[0] ); Debug(LDAP_DEBUG_ANY|LDAP_DEBUG_NONE, "%s: %s\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return(ARG_BAD_CONF); } switch(arg_type) { @@ -297,17 +297,17 @@ int config_set_vals(ConfigTable *Conf, ConfigArgs *c) { arg_type = Conf->arg_type; if(arg_type & ARG_MAGIC) { if(!c->be) c->be = frontendDB; - c->msg[0] = '\0'; + c->cr_msg[0] = '\0'; rc = (*((ConfigDriver*)Conf->arg_item))(c); #if 0 if(c->be == frontendDB) c->be = NULL; #endif if(rc) { - if ( !c->msg[0] ) { - snprintf( c->msg, sizeof( c->msg ), "<%s> handler exited with %d", + if ( !c->cr_msg[0] ) { + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> handler exited with %d", c->argv[0], rc ); Debug(LDAP_DEBUG_CONFIG, "%s: %s!\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); } return(ARG_BAD_CONF); } @@ -319,10 +319,10 @@ int config_set_vals(ConfigTable *Conf, ConfigArgs *c) { else if (c->bi) ptr = c->bi->bi_private; else { - snprintf( c->msg, sizeof( c->msg ), "<%s> offset is missing base pointer", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> offset is missing base pointer", c->argv[0] ); Debug(LDAP_DEBUG_CONFIG, "%s: %s!\n", - c->log, c->msg, 0); + c->log, c->cr_msg, 0); return(ARG_BAD_CONF); } ptr = (void *)((char *)ptr + (long)Conf->arg_item); diff --git a/servers/slapd/config.h b/servers/slapd/config.h index ea12fcd438..be5e2925a8 100644 --- a/servers/slapd/config.h +++ b/servers/slapd/config.h @@ -107,6 +107,11 @@ typedef struct ConfigOCs { typedef int (ConfigDriver)(struct config_args_s *c); +typedef struct config_reply_s { + int err; + char msg[SLAP_TEXT_BUFLEN]; +} ConfigReply; + typedef struct config_args_s { int argc; char **argv; @@ -116,7 +121,8 @@ typedef struct config_args_s { const char *fname; int lineno; char log[MAXPATHLEN + STRLENOF(": line 18446744073709551615") + 1]; - char msg[SLAP_TEXT_BUFLEN]; +#define cr_msg reply.msg + ConfigReply reply; int depth; int valx; /* multi-valued value index */ /* parsed first val for simple cases */ diff --git a/servers/slapd/oidm.c b/servers/slapd/oidm.c index 6b5c4c61ac..287937f03c 100644 --- a/servers/slapd/oidm.c +++ b/servers/slapd/oidm.c @@ -105,22 +105,22 @@ parse_oidm( oidv = oidm_find( c->argv[2] ); if( !oidv ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: OID %s not recognized", c->argv[0], c->argv[2] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); return 1; } oid = oidm_find( c->argv[1] ); if( oid != NULL ) { int rc; - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: \"%s\" previously defined \"%s\"", c->argv[0], c->argv[1], oid ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); /* Allow duplicate if the definition is identical */ rc = strcmp( oid, oidv ) != 0; SLAP_FREE( oid ); @@ -131,10 +131,10 @@ parse_oidm( om = (OidMacro *) SLAP_CALLOC( sizeof(OidMacro), 1 ); if( om == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: SLAP_CALLOC failed", c->argv[0] ); Debug( LDAP_DEBUG_ANY, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); if ( oidv != c->argv[2] ) SLAP_FREE( oidv ); return 1; diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 48aaed09cb..b456dc13f0 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -656,10 +656,10 @@ log_cf_gen(ConfigArgs *c) value_add_one( &c->rvalue_vals, li->li_db->be_suffix ); value_add_one( &c->rvalue_nvals, li->li_db->be_nsuffix ); } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "accesslog: \"logdb \" must be specified" ); Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->value_dn.bv_val ); + c->log, c->cr_msg, c->value_dn.bv_val ); rc = 1; break; } @@ -769,11 +769,11 @@ log_cf_gen(ConfigArgs *c) if ( CONFIG_ONLINE_ADD( c )) { li->li_db = select_backend( &c->value_ndn, 0 ); if ( !li->li_db ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> no matching backend found for suffix", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", - c->log, c->msg, c->value_dn.bv_val ); + c->log, c->cr_msg, c->value_dn.bv_val ); rc = 1; } ch_free( c->value_ndn.bv_val ); @@ -814,7 +814,7 @@ log_cf_gen(ConfigArgs *c) case LOG_OLD: li->li_oldf = str2filter( c->argv[1] ); if ( !li->li_oldf ) { - sprintf( c->msg, "bad filter!" ); + sprintf( c->cr_msg, "bad filter!" ); rc = 1; } break; @@ -831,10 +831,10 @@ log_cf_gen(ConfigArgs *c) la->next = li->li_oldattrs; li->li_oldattrs = la; } else { - snprintf( c->msg, sizeof( c->msg ), "%s <%s>: %s", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s <%s>: %s", c->argv[0], c->argv[i], text ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); rc = ARG_BAD_CONF; break; } @@ -1479,7 +1479,7 @@ static slap_overinst accesslog; static int accesslog_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -1494,7 +1494,7 @@ accesslog_db_init( static int accesslog_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -1611,7 +1611,7 @@ accesslog_db_root( static int accesslog_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/overlays/auditlog.c b/servers/slapd/overlays/auditlog.c index 1d65e1b5b6..8879ee39f4 100644 --- a/servers/slapd/overlays/auditlog.c +++ b/servers/slapd/overlays/auditlog.c @@ -185,7 +185,7 @@ static slap_overinst auditlog; static int auditlog_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -199,7 +199,7 @@ auditlog_db_init( static int auditlog_db_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -213,7 +213,7 @@ auditlog_db_close( static int auditlog_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/overlays/constraint.c b/servers/slapd/overlays/constraint.c index 09712ceeea..aed82a6620 100644 --- a/servers/slapd/overlays/constraint.c +++ b/servers/slapd/overlays/constraint.c @@ -168,10 +168,10 @@ constraint_cf_gen( ConfigArgs *c ) switch (c->type) { case CONSTRAINT_ATTRIBUTE: if ( slap_str2ad( c->argv[1], &ap.ap, &text ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s <%s>: %s\n", c->argv[0], c->argv[1], text ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return( ARG_BAD_CONF ); } @@ -185,21 +185,21 @@ constraint_cf_gen( ConfigArgs *c ) regerror( err, ap.re, errmsg, sizeof(errmsg) ); ch_free(ap.re); - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %s: Illegal regular expression \"%s\": Error %s", c->argv[0], c->argv[1], c->argv[3], errmsg); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); ap.re = NULL; return( ARG_BAD_CONF ); } ap.re_str = ch_strdup( c->argv[3] ); } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %s: Unknown constraint type: %s", c->argv[0], c->argv[1], c->argv[2] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return ( ARG_BAD_CONF ); } @@ -344,7 +344,7 @@ constraint_modify( Operation *op, SlapReply *rs ) static int constraint_close( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; constraint *ap, *a2; diff --git a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c index 25e920b3df..aee748674b 100644 --- a/servers/slapd/overlays/dds.c +++ b/servers/slapd/overlays/dds.c @@ -1363,20 +1363,20 @@ dds_cfgen( ConfigArgs *c ) case DDS_MAXTTL: if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "DDS unable to parse dds-max-ttl \"%s\"", c->argv[ 1 ] ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } if ( t < DDS_RF2589_DEFAULT_TTL || t > DDS_RF2589_MAX_TTL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "DDS invalid dds-max-ttl=%ld; must be between %d and %d", t, DDS_RF2589_DEFAULT_TTL, DDS_RF2589_MAX_TTL ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } @@ -1385,20 +1385,20 @@ dds_cfgen( ConfigArgs *c ) case DDS_MINTTL: if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "DDS unable to parse dds-min-ttl \"%s\"", c->argv[ 1 ] ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } if ( t < 0 || t > DDS_RF2589_MAX_TTL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "DDS invalid dds-min-ttl=%ld", t ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } @@ -1412,20 +1412,20 @@ dds_cfgen( ConfigArgs *c ) case DDS_DEFAULTTTL: if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "DDS unable to parse dds-default-ttl \"%s\"", c->argv[ 1 ] ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } if ( t < 0 || t > DDS_RF2589_MAX_TTL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "DDS invalid dds-default-ttl=%ld", t ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } @@ -1439,20 +1439,20 @@ dds_cfgen( ConfigArgs *c ) case DDS_INTERVAL: if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "DDS unable to parse dds-interval \"%s\"", c->argv[ 1 ] ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } if ( t <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "DDS invalid dds-interval=%ld", t ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } @@ -1476,20 +1476,20 @@ dds_cfgen( ConfigArgs *c ) case DDS_TOLERANCE: if ( lutil_parse_time( c->argv[ 1 ], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg), + snprintf( c->cr_msg, sizeof( c->cr_msg), "DDS unable to parse dds-tolerance \"%s\"", c->argv[ 1 ] ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } if ( t < 0 || t > DDS_RF2589_MAX_TTL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "DDS invalid dds-tolerance=%ld", t ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } @@ -1498,10 +1498,10 @@ dds_cfgen( ConfigArgs *c ) case DDS_MAXDYNAMICOBJS: if ( c->value_int < 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "DDS invalid dds-max-dynamicObjects=%d", c->value_int ); Log2( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR, - "%s: %s.\n", c->log, c->msg ); + "%s: %s.\n", c->log, c->cr_msg ); return 1; } di->di_max_dynamicObjects = c->value_int; @@ -1518,7 +1518,7 @@ dds_cfgen( ConfigArgs *c ) static int dds_db_init( BackendDB *be, - ConfigArgs *ca) + ConfigReply *cr) { slap_overinst *on = (slap_overinst *)be->bd_info; dds_info_t *di; @@ -1668,7 +1668,7 @@ done_search:; static int dds_db_open( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; dds_info_t *di = on->on_bi.bi_private; @@ -1734,7 +1734,7 @@ done:; static int dds_db_close( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; dds_info_t *di = on->on_bi.bi_private; @@ -1757,7 +1757,7 @@ dds_db_close( static int dds_db_destroy( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; dds_info_t *di = on->on_bi.bi_private; diff --git a/servers/slapd/overlays/dyngroup.c b/servers/slapd/overlays/dyngroup.c index 08532866dc..2d0b23065d 100644 --- a/servers/slapd/overlays/dyngroup.c +++ b/servers/slapd/overlays/dyngroup.c @@ -135,7 +135,7 @@ static int dyngroup_config( static int dyngroup_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 5aa1e32976..4338efd33f 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -982,12 +982,12 @@ dl_cfgen( ConfigArgs *c ) case DL_ATTRSET: for ( i = 0; dli; i++, dli = dli->dli_next ) { struct berval bv; - char *ptr = c->msg; + char *ptr = c->cr_msg; assert( dli->dli_oc != NULL ); assert( dli->dli_ad != NULL ); - ptr += snprintf( c->msg, sizeof( c->msg ), + ptr += snprintf( c->cr_msg, sizeof( c->cr_msg ), SLAP_X_ORDERED_FMT "%s %s", i, dli->dli_oc->soc_cname.bv_val, dli->dli_ad->ad_cname.bv_val ); @@ -998,7 +998,7 @@ dl_cfgen( ConfigArgs *c ) ptr = lutil_strcopy( ptr, dli->dli_member_ad->ad_cname.bv_val ); } - bv.bv_val = c->msg; + bv.bv_val = c->cr_msg; bv.bv_len = ptr - bv.bv_val; value_add_one( &c->rvalue_vals, &bv ); } @@ -1076,46 +1076,46 @@ dl_cfgen( ConfigArgs *c ) oc = oc_find( c->argv[ 1 ] ); if ( oc == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "unable to find ObjectClass \"%s\"", c->argv[ 1 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } rc = slap_str2ad( c->argv[ 2 ], &ad, &text ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "unable to find AttributeDescription \"%s\"", c->argv[ 2 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } if ( !is_at_subtype( ad->ad_type, slap_schema.si_ad_labeledURI->ad_type ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "AttributeDescription \"%s\" " "must be a subtype of \"labeledURI\"", c->argv[ 2 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } if ( c->argc == 4 ) { rc = slap_str2ad( c->argv[ 3 ], &member_ad, &text ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "unable to find AttributeDescription \"%s\"\n", c->argv[ 3 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } } @@ -1126,12 +1126,12 @@ dl_cfgen( ConfigArgs *c ) /* The same URL attribute / member attribute pair * cannot be repeated */ if ( (*dlip)->dli_ad == ad && (*dlip)->dli_member_ad == member_ad ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "URL attributeDescription \"%s\" already mapped.\n", ad->ad_cname.bv_val ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); #if 0 /* make it a warning... */ return 1; @@ -1146,12 +1146,12 @@ dl_cfgen( ConfigArgs *c ) i < c->valx; i++ ) { if ( *dlip == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "invalid index {%d}\n", c->valx ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } dlip = &(*dlip)->dli_next; @@ -1176,10 +1176,10 @@ dl_cfgen( ConfigArgs *c ) } break; case DL_ATTRPAIR_COMPAT: - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "warning: \"attrpair\" only supported for limited " "backward compatibility with overlay \"dyngroup\"" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); /* fallthru */ case DL_ATTRPAIR: { @@ -1191,44 +1191,44 @@ dl_cfgen( ConfigArgs *c ) oc = oc_find( "groupOfURLs" ); if ( oc == NULL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrpair \": " "unable to find default ObjectClass \"groupOfURLs\"" ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } rc = slap_str2ad( c->argv[ 1 ], &member_ad, &text ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrpair \": " "unable to find AttributeDescription \"%s\"", c->argv[ 1 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } rc = slap_str2ad( c->argv[ 2 ], &ad, &text ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrpair \": " "unable to find AttributeDescription \"%s\"\n", c->argv[ 2 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } if ( !is_at_subtype( ad->ad_type, slap_schema.si_ad_labeledURI->ad_type ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrset []\": " "AttributeDescription \"%s\" " "must be a subtype of \"labeledURI\"", c->argv[ 2 ] ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); return 1; } @@ -1238,12 +1238,12 @@ dl_cfgen( ConfigArgs *c ) /* The same URL attribute / member attribute pair * cannot be repeated */ if ( (*dlip)->dli_ad == ad && (*dlip)->dli_member_ad == member_ad ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"dynlist-attrpair \": " "URL attributeDescription \"%s\" already mapped.\n", ad->ad_cname.bv_val ); Debug( LDAP_DEBUG_ANY, "%s: %s.\n", - c->log, c->msg, 0 ); + c->log, c->cr_msg, 0 ); #if 0 /* make it a warning... */ return 1; @@ -1273,7 +1273,7 @@ dl_cfgen( ConfigArgs *c ) static int dynlist_db_open( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; dynlist_info_t *dli = (dynlist_info_t *)on->on_bi.bi_private; @@ -1331,7 +1331,7 @@ dynlist_db_open( static int dynlist_db_destroy( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 7ec44a8dd2..43f3981f1f 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -1803,8 +1803,8 @@ pc_cfadd( Operation *op, SlapReply *rs, Entry *p, ConfigArgs *ca ) struct berval bv; /* FIXME: should not hardcode "olcDatabase" here */ - bv.bv_len = sprintf( ca->msg, "olcDatabase=%s", cm->db.bd_info->bi_type ); - bv.bv_val = ca->msg; + bv.bv_len = sprintf( ca->cr_msg, "olcDatabase=%s", cm->db.bd_info->bi_type ); + bv.bv_val = ca->cr_msg; ca->be = &cm->db; /* We can only create this entry if the database is table-driven @@ -1834,17 +1834,17 @@ pc_cf_gen( ConfigArgs *c ) struct berval bv; switch( c->type ) { case PC_MAIN: - bv.bv_len = snprintf( c->msg, sizeof( c->msg ), "%s %d %d %d %ld", + bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %d %d %d %ld", cm->db.bd_info->bi_type, cm->max_entries, cm->numattrsets, cm->num_entries_limit, cm->cc_period ); - bv.bv_val = c->msg; + bv.bv_val = c->cr_msg; value_add_one( &c->rvalue_vals, &bv ); break; case PC_ATTR: for (i=0; inumattrsets; i++) { if ( !qm->attr_sets[i].count ) continue; - bv.bv_len = snprintf( c->msg, sizeof( c->msg ), "%d", i ); + bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), "%d", i ); /* count the attr length */ for ( attr_name = qm->attr_sets[i].attrs; @@ -1852,7 +1852,7 @@ pc_cf_gen( ConfigArgs *c ) bv.bv_len += attr_name->an_name.bv_len + 1; bv.bv_val = ch_malloc( bv.bv_len+1 ); - ptr = lutil_strcopy( bv.bv_val, c->msg ); + ptr = lutil_strcopy( bv.bv_val, c->cr_msg ); for ( attr_name = qm->attr_sets[i].attrs; attr_name->an_name.bv_val; attr_name++ ) { *ptr++ = ' '; @@ -1866,13 +1866,13 @@ pc_cf_gen( ConfigArgs *c ) case PC_TEMP: for (temp=qm->templates; temp; temp=temp->qmnext) { if ( temp->negttl ) { - bv.bv_len = snprintf( c->msg, sizeof( c->msg ), + bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), " %d %ld %ld", temp->attr_set_index, temp->ttl, temp->negttl ); } else { - bv.bv_len = snprintf( c->msg, sizeof( c->msg ), " %d %ld", + bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), " %d %ld", temp->attr_set_index, temp->ttl ); } @@ -1882,7 +1882,7 @@ pc_cf_gen( ConfigArgs *c ) *ptr++ = '"'; ptr = lutil_strcopy( ptr, temp->querystr.bv_val ); *ptr++ = '"'; - strcpy( ptr, c->msg ); + strcpy( ptr, c->cr_msg ); ber_bvarray_add( &c->rvalue_vals, &bv ); } if ( !c->rvalue_vals ) @@ -1915,67 +1915,67 @@ pc_cf_gen( ConfigArgs *c ) switch( c->type ) { case PC_MAIN: if ( cm->numattrsets > 0 ) { - snprintf( c->msg, sizeof( c->msg ), "\"proxycache\" directive already provided" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"proxycache\" directive already provided" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( lutil_atoi( &cm->numattrsets, c->argv[3] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse num attrsets=\"%s\" (arg #3)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse num attrsets=\"%s\" (arg #3)", c->argv[3] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( cm->numattrsets <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), "numattrsets (arg #3) must be positive" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "numattrsets (arg #3) must be positive" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( cm->numattrsets > MAX_ATTR_SETS ) { - snprintf( c->msg, sizeof( c->msg ), "numattrsets (arg #3) must be <= %d", MAX_ATTR_SETS ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "numattrsets (arg #3) must be <= %d", MAX_ATTR_SETS ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( !backend_db_init( c->argv[1], &cm->db, -1, NULL )) { - snprintf( c->msg, sizeof( c->msg ), "unknown backend type (arg #1)" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unknown backend type (arg #1)" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( lutil_atoi( &cm->max_entries, c->argv[2] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse max entries=\"%s\" (arg #2)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse max entries=\"%s\" (arg #2)", c->argv[2] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( cm->max_entries <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), "max entries (arg #2) must be positive.\n" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "max entries (arg #2) must be positive.\n" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( lutil_atoi( &cm->num_entries_limit, c->argv[4] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse entry limit=\"%s\" (arg #4)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse entry limit=\"%s\" (arg #4)", c->argv[4] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( cm->num_entries_limit <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), "entry limit (arg #4) must be positive" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "entry limit (arg #4) must be positive" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( cm->num_entries_limit > cm->max_entries ) { - snprintf( c->msg, sizeof( c->msg ), "entry limit (arg #4) must be less than max entries %d (arg #2)", cm->max_entries ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "entry limit (arg #4) must be less than max entries %d (arg #2)", cm->max_entries ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( lutil_parse_time( c->argv[5], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse period=\"%s\" (arg #5)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse period=\"%s\" (arg #5)", c->argv[5] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } cm->cc_period = (time_t)t; @@ -1987,21 +1987,21 @@ pc_cf_gen( ConfigArgs *c ) break; case PC_ATTR: if ( cm->numattrsets == 0 ) { - snprintf( c->msg, sizeof( c->msg ), "\"proxycache\" directive not provided yet" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"proxycache\" directive not provided yet" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( lutil_atoi( &num, c->argv[1] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse attrset #=\"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse attrset #=\"%s\"", c->argv[1] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( num < 0 || num >= cm->numattrsets ) { - snprintf( c->msg, sizeof( c->msg ), "attrset index %d out of bounds (must be %s%d)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "attrset index %d out of bounds (must be %s%d)", num, cm->numattrsets > 1 ? "0->" : "", cm->numattrsets - 1 ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } qm->attr_sets[num].flags |= PC_CONFIGURED; @@ -2015,8 +2015,8 @@ pc_cf_gen( ConfigArgs *c ) if ( slap_str2ad( c->argv[i], &attr_name->an_desc, &text ) ) { - strcpy( c->msg, text ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + strcpy( c->cr_msg, text ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); ch_free( qm->attr_sets[num].attrs ); qm->attr_sets[num].attrs = NULL; qm->attr_sets[num].count = 0; @@ -2034,22 +2034,22 @@ pc_cf_gen( ConfigArgs *c ) break; case PC_TEMP: if ( cm->numattrsets == 0 ) { - snprintf( c->msg, sizeof( c->msg ), "\"proxycache\" directive not provided yet" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "\"proxycache\" directive not provided yet" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( lutil_atoi( &i, c->argv[2] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse template #=\"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse template #=\"%s\"", c->argv[2] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } if ( i < 0 || i >= cm->numattrsets || !(qm->attr_sets[i].flags & PC_CONFIGURED )) { - snprintf( c->msg, sizeof( c->msg ), "template index %d invalid (%s%d)", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "template index %d invalid (%s%d)", i, cm->numattrsets > 1 ? "0->" : "", cm->numattrsets - 1 ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } temp = ch_calloc( 1, sizeof( QueryTemplate )); @@ -2058,18 +2058,18 @@ pc_cf_gen( ConfigArgs *c ) ldap_pvt_thread_rdwr_init( &temp->t_rwlock ); temp->query = temp->query_last = NULL; if ( lutil_parse_time( c->argv[3], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "unable to parse template ttl=\"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse template ttl=\"%s\"", c->argv[3] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } temp->ttl = (time_t)t; if ( c->argc == 5 ) { if ( lutil_parse_time( c->argv[4], &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unable to parse template negttl=\"%s\"", c->argv[4] ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } temp->negttl = (time_t)t; @@ -2102,15 +2102,15 @@ pc_cf_gen( ConfigArgs *c ) cm->response_cb = PCACHE_RESPONSE_CB_TAIL; } else { - snprintf( c->msg, sizeof( c->msg ), "unknown specifier" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unknown specifier" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } break; case PC_QUERIES: if ( c->value_int <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), "max queries must be positive" ); - Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->msg, 0 ); + snprintf( c->cr_msg, sizeof( c->cr_msg ), "max queries must be positive" ); + Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 ); return( 1 ); } cm->max_queries = c->value_int; @@ -2141,7 +2141,7 @@ pcache_db_config( static int pcache_db_init( BackendDB *be, - ConfigArgs *ca) + ConfigReply *cr) { slap_overinst *on = (slap_overinst *)be->bd_info; cache_manager *cm; @@ -2184,7 +2184,7 @@ pcache_db_init( static int pcache_db_open( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; cache_manager *cm = on->on_bi.bi_private; @@ -2273,7 +2273,7 @@ pcache_free_qbase( void *v ) static int pcache_db_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -2315,7 +2315,7 @@ pcache_db_close( static int pcache_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index c8322bcbf7..137e907649 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -2075,7 +2075,7 @@ attrNormalize( static int ppolicy_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; @@ -2119,7 +2119,7 @@ ppolicy_db_init( static int ppolicy_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { return overlay_register_control( be, LDAP_CONTROL_PASSWORDPOLICYREQUEST ); @@ -2128,7 +2128,7 @@ ppolicy_db_open( static int ppolicy_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index 81cd1f398b..28f874dca6 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -209,10 +209,10 @@ refint_cf_gen(ConfigArgs *c) ip->next = dd->attrs; dd->attrs = ip; } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s <%s>: %s", c->argv[0], c->argv[i], text ); Debug ( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); rc = ARG_BAD_CONF; } } @@ -246,7 +246,7 @@ refint_cf_gen(ConfigArgs *c) static int refint_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -261,7 +261,7 @@ refint_db_init( static int refint_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -283,7 +283,7 @@ refint_db_destroy( static int refint_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -312,7 +312,7 @@ refint_open( static int refint_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; diff --git a/servers/slapd/overlays/retcode.c b/servers/slapd/overlays/retcode.c index 5bea3b73c7..f5bca0ab1d 100644 --- a/servers/slapd/overlays/retcode.c +++ b/servers/slapd/overlays/retcode.c @@ -726,7 +726,7 @@ retcode_response( Operation *op, SlapReply *rs ) } static int -retcode_db_init( BackendDB *be, ConfigArgs *ca ) +retcode_db_init( BackendDB *be, ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; retcode_t *rd; @@ -1088,7 +1088,7 @@ retcode_db_config( } static int -retcode_db_open( BackendDB *be, ConfigArgs *ca) +retcode_db_open( BackendDB *be, ConfigReply *cr) { slap_overinst *on = (slap_overinst *)be->bd_info; retcode_t *rd = (retcode_t *)on->on_bi.bi_private; @@ -1212,7 +1212,7 @@ retcode_db_open( BackendDB *be, ConfigArgs *ca) } static int -retcode_db_destroy( BackendDB *be, ConfigArgs *ca ) +retcode_db_destroy( BackendDB *be, ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; retcode_t *rd = (retcode_t *)on->on_bi.bi_private; diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index e99ccd279e..e8cd82073f 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -39,7 +39,7 @@ typedef struct rwm_op_state { } rwm_op_state; static int -rwm_db_destroy( BackendDB *be, ConfigArgs *ca ); +rwm_db_destroy( BackendDB *be, ConfigReply *cr ); typedef struct rwm_op_cb { slap_callback cb; @@ -1904,7 +1904,7 @@ rwm_cf_gen( ConfigArgs *c ) static int rwm_db_init( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; struct ldaprwmap *rwmap; @@ -1944,7 +1944,7 @@ error_return:; static int rwm_db_destroy( BackendDB *be, - ConfigArgs *ca ) + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; int rc = 0; diff --git a/servers/slapd/overlays/seqmod.c b/servers/slapd/overlays/seqmod.c index d2886fed61..a871f546f1 100644 --- a/servers/slapd/overlays/seqmod.c +++ b/servers/slapd/overlays/seqmod.c @@ -141,7 +141,7 @@ seqmod_op_extended( static int seqmod_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -158,7 +158,7 @@ seqmod_db_open( static int seqmod_db_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index d785e17b08..ff36ef0a20 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -2370,9 +2370,9 @@ sp_cf_gen(ConfigArgs *c) case SP_CHKPT: if ( si->si_chkops || si->si_chktime ) { struct berval bv; - bv.bv_len = sprintf( c->msg, "%d %d", + bv.bv_len = sprintf( c->cr_msg, "%d %d", si->si_chkops, si->si_chktime ); - bv.bv_val = c->msg; + bv.bv_val = c->cr_msg; value_add_one( &c->rvalue_vals, &bv ); } else { rc = 1; @@ -2431,31 +2431,31 @@ sp_cf_gen(ConfigArgs *c) switch ( c->type ) { case SP_CHKPT: if ( lutil_atoi( &si->si_chkops, c->argv[1] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "%s unable to parse checkpoint ops # \"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s unable to parse checkpoint ops # \"%s\"", c->argv[0], c->argv[1] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return ARG_BAD_CONF; } if ( si->si_chkops <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), "%s invalid checkpoint ops # \"%d\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s invalid checkpoint ops # \"%d\"", c->argv[0], si->si_chkops ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return ARG_BAD_CONF; } if ( lutil_atoi( &si->si_chktime, c->argv[2] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), "%s unable to parse checkpoint time \"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s unable to parse checkpoint time \"%s\"", c->argv[0], c->argv[1] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return ARG_BAD_CONF; } if ( si->si_chktime <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), "%s invalid checkpoint time \"%d\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s invalid checkpoint time \"%d\"", c->argv[0], si->si_chkops ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return ARG_BAD_CONF; } si->si_chktime *= 60; @@ -2465,10 +2465,10 @@ sp_cf_gen(ConfigArgs *c) int size = c->value_int; if ( size < 0 ) { - snprintf( c->msg, sizeof( c->msg ), "%s size %d is negative", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s size %d is negative", c->argv[0], size ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); return ARG_BAD_CONF; } sl = si->si_logs; @@ -2513,7 +2513,7 @@ syncprov_db_otask( static int syncprov_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; @@ -2607,7 +2607,7 @@ out: static int syncprov_db_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; @@ -2638,7 +2638,7 @@ syncprov_db_close( static int syncprov_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -2671,7 +2671,7 @@ syncprov_db_init( static int syncprov_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c index c8d3452e05..4d99cba311 100644 --- a/servers/slapd/overlays/translucent.c +++ b/servers/slapd/overlays/translucent.c @@ -103,9 +103,9 @@ translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca ) Debug(LDAP_DEBUG_TRACE, "==> translucent_cfadd\n", 0, 0, 0); /* FIXME: should not hardcode "olcDatabase" here */ - bv.bv_len = sprintf( ca->msg, "olcDatabase=%s", + bv.bv_len = sprintf( ca->cr_msg, "olcDatabase=%s", ov->db.bd_info->bi_type ); - bv.bv_val = ca->msg; + bv.bv_val = ca->cr_msg; ca->be = &ov->db; /* We can only create this entry if the database is table-driven @@ -686,7 +686,7 @@ static int translucent_db_config( ** */ -static int translucent_db_init(BackendDB *be, ConfigArgs *ca) { +static int translucent_db_init(BackendDB *be, ConfigReply *cr) { slap_overinst *on = (slap_overinst *) be->bd_info; translucent_info *ov; @@ -714,7 +714,7 @@ static int translucent_db_init(BackendDB *be, ConfigArgs *ca) { ** */ -static int translucent_db_open(BackendDB *be, ConfigArgs *ca) { +static int translucent_db_open(BackendDB *be, ConfigReply *cr) { slap_overinst *on = (slap_overinst *) be->bd_info; translucent_info *ov = on->on_bi.bi_private; int rc; @@ -743,7 +743,7 @@ static int translucent_db_open(BackendDB *be, ConfigArgs *ca) { */ static int -translucent_db_close( BackendDB *be, ConfigArgs *ca ) +translucent_db_close( BackendDB *be, ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; translucent_info *ov = on->on_bi.bi_private; @@ -765,7 +765,7 @@ translucent_db_close( BackendDB *be, ConfigArgs *ca ) */ static int -translucent_db_destroy( BackendDB *be, ConfigArgs *ca ) +translucent_db_destroy( BackendDB *be, ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; translucent_info *ov = on->on_bi.bi_private; diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index 7c649190aa..68154eaec3 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -190,7 +190,7 @@ unique_new_domain_uri ( unique_domain_uri **urip, uri->ndn, NULL ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid DN %d (%s)", url_desc->lud_dn, rc, ldap_err2string( rc )); rc = ARG_BAD_CONF; @@ -198,7 +198,7 @@ unique_new_domain_uri ( unique_domain_uri **urip, } if ( !dnIsSuffix ( uri->ndn, &be->be_nsuffix[0] ) ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "dn <%s> is not a suffix of backend base dn <%s>", uri->dn->bv_val, be->be_nsuffix[0].bv_val ); @@ -220,7 +220,7 @@ unique_new_domain_uri ( unique_domain_uri **urip, attr->next = uri->attrs; uri->attrs = attr; } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unique: attribute: %s: %s", attr_str[i], text ); rc = ARG_BAD_CONF; @@ -231,7 +231,7 @@ unique_new_domain_uri ( unique_domain_uri **urip, uri->scope = url_desc->lud_scope; if ( !uri->scope ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unique: uri with base scope will always be unique"); rc = ARG_BAD_CONF; goto exit; @@ -242,7 +242,7 @@ unique_new_domain_uri ( unique_domain_uri **urip, uri->filter = ber_str2bv( url_desc->lud_filter, 0, 1, NULL); f = str2filter( uri->filter->bv_val ); if ( !f ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unique: bad filter"); rc = ARG_BAD_CONF; goto exit; @@ -255,7 +255,7 @@ exit: *urip = uri; if ( rc ) { Debug ( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); unique_free_domain_uri ( uri ); *urip = NULL; } @@ -326,7 +326,7 @@ unique_new_domain ( unique_domain **domainp, } rc = ldap_url_parselist_ext ( &url_descs, uri_start, " ", 0 ); if ( rc ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid ldap urilist", uri_start ); rc = ARG_BAD_CONF; @@ -352,7 +352,7 @@ exit: *domainp = domain; if ( rc ) { Debug ( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); unique_free_domain ( domain ); *domainp = NULL; } @@ -401,19 +401,19 @@ unique_cf_base( ConfigArgs *c ) case LDAP_MOD_ADD: case SLAP_CONFIG_ADD: if ( domains ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "cannot set legacy attrs when URIs are present" ); Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n", - c->msg, NULL, NULL ); + c->cr_msg, NULL, NULL ); rc = ARG_BAD_CONF; break; } if ( !dnIsSuffix ( &c->value_ndn, &be->be_nsuffix[0] ) ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "dn is not a suffix of backend base" ); Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n", - c->msg, NULL, NULL ); + c->cr_msg, NULL, NULL ); rc = ARG_BAD_CONF; break; } @@ -499,10 +499,10 @@ unique_cf_attrs( ConfigArgs *c ) case LDAP_MOD_ADD: case SLAP_CONFIG_ADD: if ( domains ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "cannot set legacy attrs when URIs are present" ); Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n", - c->msg, NULL, NULL ); + c->cr_msg, NULL, NULL ); rc = ARG_BAD_CONF; break; } @@ -510,10 +510,10 @@ unique_cf_attrs( ConfigArgs *c ) && legacy->uri && legacy->uri->attrs && (c->type == UNIQUE_IGNORE) != legacy->ignore ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "cannot set both attrs and ignore-attrs" ); Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n", - c->msg, NULL, NULL ); + c->cr_msg, NULL, NULL ); rc = ARG_BAD_CONF; break; } @@ -538,7 +538,7 @@ unique_cf_attrs( ConfigArgs *c ) attr->next = new_attrs; new_attrs = attr; } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "unique: attribute: %s: %s", c->argv[i], text ); for ( attr = new_attrs; @@ -575,7 +575,7 @@ unique_cf_attrs( ConfigArgs *c ) if ( rc ) { Debug ( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s: %s\n", c->log, c->msg, 0 ); + "%s: %s\n", c->log, c->cr_msg, 0 ); } return rc; } @@ -620,10 +620,10 @@ unique_cf_strict( ConfigArgs *c ) case LDAP_MOD_ADD: case SLAP_CONFIG_ADD: if ( domains ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "cannot set legacy attrs when URIs are present" ); Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n", - c->msg, NULL, NULL ); + c->cr_msg, NULL, NULL ); rc = ARG_BAD_CONF; break; } @@ -705,10 +705,10 @@ unique_cf_uri( ConfigArgs *c ) case SLAP_CONFIG_ADD: /* fallthrough */ case LDAP_MOD_ADD: if ( legacy ) { - sprintf ( c->msg, + sprintf ( c->cr_msg, "cannot set Uri when legacy attrs are present" ); Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n", - c->msg, NULL, NULL ); + c->cr_msg, NULL, NULL ); rc = ARG_BAD_CONF; break; } @@ -741,7 +741,7 @@ unique_cf_uri( ConfigArgs *c ) static int unique_db_init( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -757,7 +757,7 @@ unique_db_init( static int unique_db_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; @@ -782,7 +782,7 @@ unique_db_destroy( static int unique_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { Debug(LDAP_DEBUG_TRACE, "unique_open: overlay initialized\n", 0, 0, 0); @@ -799,7 +799,7 @@ unique_open( static int unique_close( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *) be->bd_info; diff --git a/servers/slapd/overlays/valsort.c b/servers/slapd/overlays/valsort.c index a06d83a985..5950a208c4 100644 --- a/servers/slapd/overlays/valsort.c +++ b/servers/slapd/overlays/valsort.c @@ -152,16 +152,16 @@ valsort_cf_func(ConfigArgs *c) { vitmp.vi_ad = NULL; i = slap_str2ad( c->argv[1], &vitmp.vi_ad, &text ); if ( i ) { - sprintf( c->msg, "<%s> %s", c->argv[0], text ); + sprintf( c->cr_msg, "<%s> %s", c->argv[0], text ); Debug( LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return(1); } if ( is_at_single_value( vitmp.vi_ad->ad_type )) { - sprintf( c->msg, "<%s> %s is single-valued, ignoring", c->argv[0], + sprintf( c->cr_msg, "<%s> %s is single-valued, ignoring", c->argv[0], vitmp.vi_ad->ad_cname.bv_val ); Debug( LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return(0); } is_numeric = ( vitmp.vi_ad->ad_type->sat_syntax == syn_numericString || @@ -170,34 +170,34 @@ valsort_cf_func(ConfigArgs *c) { ber_str2bv( c->argv[2], 0, 0, &bv ); i = dnNormalize( 0, NULL, NULL, &bv, &vitmp.vi_dn, NULL ); if ( i ) { - sprintf( c->msg, "<%s> unable to normalize DN", c->argv[0] ); + sprintf( c->cr_msg, "<%s> unable to normalize DN", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[2] ); + c->log, c->cr_msg, c->argv[2] ); return(1); } i = verb_to_mask( c->argv[3], sorts ); if ( BER_BVISNULL( &sorts[i].word )) { - sprintf( c->msg, "<%s> unrecognized sort type", c->argv[0] ); + sprintf( c->cr_msg, "<%s> unrecognized sort type", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[3] ); + c->log, c->cr_msg, c->argv[3] ); return(1); } vitmp.vi_sort = sorts[i].mask; if ( sorts[i].mask == VALSORT_WEIGHTED && c->argc == 5 ) { i = verb_to_mask( c->argv[4], sorts ); if ( BER_BVISNULL( &sorts[i].word )) { - sprintf( c->msg, "<%s> unrecognized sort type", c->argv[0] ); + sprintf( c->cr_msg, "<%s> unrecognized sort type", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[4] ); + c->log, c->cr_msg, c->argv[4] ); return(1); } vitmp.vi_sort |= sorts[i].mask; } if (( vitmp.vi_sort & VALSORT_NUMERIC ) && !is_numeric ) { - sprintf( c->msg, "<%s> numeric sort specified for non-numeric syntax", + sprintf( c->cr_msg, "<%s> numeric sort specified for non-numeric syntax", c->argv[0] ); Debug( LDAP_DEBUG_ANY, "%s: %s (%s)!\n", - c->log, c->msg, c->argv[1] ); + c->log, c->cr_msg, c->argv[1] ); return(1); } vi = ch_malloc( sizeof(valsort_info) ); @@ -480,7 +480,7 @@ valsort_modify( Operation *op, SlapReply *rs ) static int valsort_db_open( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { return overlay_register_control( be, LDAP_CONTROL_VALSORT ); @@ -489,7 +489,7 @@ valsort_db_open( static int valsort_destroy( BackendDB *be, - ConfigArgs *ca + ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index ba4791bcf6..8b975e7615 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -32,6 +32,7 @@ LDAP_BEGIN_DECL struct config_args_s; /* config.h */ +struct config_reply_s; /* config.h */ /* * aci.c @@ -320,7 +321,7 @@ LDAP_SLAPD_F (int) backend_init LDAP_P((void)); LDAP_SLAPD_F (int) backend_add LDAP_P((BackendInfo *aBackendInfo)); LDAP_SLAPD_F (int) backend_num LDAP_P((Backend *be)); LDAP_SLAPD_F (int) backend_startup LDAP_P((Backend *be)); -LDAP_SLAPD_F (int) backend_startup_one LDAP_P((Backend *be, struct config_args_s *ca)); +LDAP_SLAPD_F (int) backend_startup_one LDAP_P((Backend *be, struct config_reply_s *cr)); LDAP_SLAPD_F (int) backend_sync LDAP_P((Backend *be)); LDAP_SLAPD_F (int) backend_shutdown LDAP_P((Backend *be)); LDAP_SLAPD_F (int) backend_destroy LDAP_P((void)); @@ -329,7 +330,7 @@ LDAP_SLAPD_F (void) backend_destroy_one LDAP_P((BackendDB *bd, int dynamic)); LDAP_SLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type )); LDAP_SLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type, - BackendDB *be, int idx, struct config_args_s *ca )); + BackendDB *be, int idx, struct config_reply_s *cr )); LDAP_SLAPD_F (void) backend_db_insert LDAP_P((BackendDB *bd, int idx)); LDAP_SLAPD_F (void) backend_db_move LDAP_P((BackendDB *bd, int idx)); diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index 93aa7da6eb..80f44f5044 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -136,19 +136,19 @@ parse_cr( cr = ldap_str2contentrule( line, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !cr ) { - snprintf( c->msg, sizeof( c->msg ), "%s: %s before %s", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: %s before %s", c->argv[0], ldap_scherr2str( code ), err ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); cr_usage(); return 1; } if ( cr->cr_oid == NULL ) { - snprintf( c->msg, sizeof( c->msg ), "%s: OID is missing", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: OID is missing", c->argv[0] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); cr_usage(); code = 1; goto done; @@ -156,10 +156,10 @@ parse_cr( code = cr_add( cr, 1, scr, &err ); if ( code ) { - snprintf( c->msg, sizeof( c->msg ), "%s: %s: \"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: %s: \"%s\"", c->argv[0], scherr2str(code), err); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); code = 1; goto done; } @@ -188,19 +188,19 @@ parse_oc( oc = ldap_str2objectclass(line, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !oc ) { - snprintf( c->msg, sizeof( c->msg ), "%s: %s before %s", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: %s before %s", c->argv[0], ldap_scherr2str( code ), err ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); oc_usage(); return 1; } if ( oc->oc_oid == NULL ) { - snprintf( c->msg, sizeof( c->msg ), "%s: OID is missing", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: OID is missing", c->argv[0] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); oc_usage(); code = 1; goto done; @@ -208,10 +208,10 @@ parse_oc( code = oc_add( oc, 1, soc, prev, &err ); if ( code ) { - snprintf( c->msg, sizeof( c->msg ), "%s: %s: \"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: %s: \"%s\"", c->argv[0], scherr2str(code), err); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); code = 1; goto done; } @@ -283,19 +283,19 @@ parse_at( at = ldap_str2attributetype( line, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !at ) { - snprintf( c->msg, sizeof( c->msg ), "%s: %s before %s", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: %s before %s", c->argv[0], ldap_scherr2str(code), err ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); at_usage(); return 1; } if ( at->at_oid == NULL ) { - snprintf( c->msg, sizeof( c->msg ), "%s: OID is missing", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: OID is missing", c->argv[0] ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); at_usage(); code = 1; goto done; @@ -303,20 +303,20 @@ parse_at( /* operational attributes should be defined internally */ if ( at->at_usage ) { - snprintf( c->msg, sizeof( c->msg ), "%s: \"%s\" is operational", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: \"%s\" is operational", c->argv[0], at->at_oid ); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); code = 1; goto done; } code = at_add( at, 1, sat, prev, &err); if ( code ) { - snprintf( c->msg, sizeof( c->msg ), "%s: %s: \"%s\"", + snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: %s: \"%s\"", c->argv[0], scherr2str(code), err); Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, - "%s %s\n", c->log, c->msg, 0 ); + "%s %s\n", c->log, c->cr_msg, 0 ); code = 1; goto done; } diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 15b102ddca..793597cbcf 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1874,8 +1874,8 @@ typedef int (BI_config) LDAP_P((BackendInfo *bi, const char *fname, int lineno, int argc, char **argv)); -struct config_args_s; /* config.h */ -typedef int (BI_db_func) LDAP_P((Backend *bd, struct config_args_s *ca)); +struct config_reply_s ; /* config.h */ +typedef int (BI_db_func) LDAP_P((Backend *bd, struct config_reply_s *c)); typedef BI_db_func BI_db_init; typedef BI_db_func BI_db_open; typedef BI_db_func BI_db_close; diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 00e2cfeb04..e9344eabd9 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -3285,17 +3285,17 @@ parse_syncrepl_line( /* '\0' string terminator accounts for '=' */ val = c->argv[ i ] + STRLENOF( IDSTR "=" ); if ( lutil_atoi( &tmp, val ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "unable to parse syncrepl id \"%s\"", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } if ( tmp >= 1000 || tmp < 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "syncrepl id %d is out of range [0..999]", tmp ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } si->si_rid = tmp; @@ -3345,10 +3345,10 @@ parse_syncrepl_line( ber_str2bv( val, 0, 0, &bv ); rc = dnNormalize( 0, NULL, NULL, &bv, &si->si_base, NULL ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Invalid base DN \"%s\": %d (%s)", val, rc, ldap_err2string( rc ) ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } gots |= GOT_BASE; @@ -3365,10 +3365,10 @@ parse_syncrepl_line( ber_str2bv( val, 0, 0, &bv ); rc = dnNormalize( 0, NULL, NULL, &bv, &si->si_logbase, NULL ); if ( rc != LDAP_SUCCESS ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Invalid logbase DN \"%s\": %d (%s)", val, rc, ldap_err2string( rc ) ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } } else if ( !strncasecmp( c->argv[ i ], SCOPESTR "=", @@ -3383,10 +3383,10 @@ parse_syncrepl_line( } } if ( BER_BVISNULL(&scopes[j].key) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "unknown scope \"%s\"", val); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } } else if ( !strncasecmp( c->argv[ i ], ATTRSONLYSTR, @@ -3463,10 +3463,10 @@ parse_syncrepl_line( si->si_type = si->si_ctype = LDAP_SYNC_REFRESH_AND_PERSIST; si->si_interval = 60; } else { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "unknown sync type \"%s\"", val); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } } else if ( !strncasecmp( c->argv[ i ], INTERVALSTR "=", @@ -3483,37 +3483,37 @@ parse_syncrepl_line( * should go before the call to strtoul() */ dd = strtoul( ptr, &next, 10 ); if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "invalid interval \"%s\", unable to parse days", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } ptr = next + 1; hh = strtoul( ptr, &next, 10 ); if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' || hh > 24 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "invalid interval \"%s\", unable to parse hours", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } ptr = next + 1; mm = strtoul( ptr, &next, 10 ); if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' || mm > 60 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "invalid interval \"%s\", unable to parse minutes", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } ptr = next + 1; ss = strtoul( ptr, &next, 10 ); if ( ptr[ 0 ] == '-' || next == ptr || next[0] != '\0' || ss > 60 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "invalid interval \"%s\", unable to parse seconds", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss; @@ -3521,20 +3521,20 @@ parse_syncrepl_line( unsigned long t; if ( lutil_parse_time( val, &t ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "invalid interval \"%s\"", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } si->si_interval = (time_t)t; } if ( si->si_interval < 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "invalid interval \"%ld\"", (long) si->si_interval); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } } else if ( !strncasecmp( c->argv[ i ], RETRYSTR "=", @@ -3552,9 +3552,9 @@ parse_syncrepl_line( for ( k = 0; retry_list && retry_list[k]; k++ ) ; n = k / 2; if ( k % 2 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: incomplete syncrepl retry list" ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); for ( k = 0; retry_list && retry_list[k]; k++ ) { ch_free( retry_list[k] ); } @@ -3567,10 +3567,10 @@ parse_syncrepl_line( for ( j = 0; j < n; j++ ) { unsigned long t; if ( lutil_atoul( &t, retry_list[j*2] ) != 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: invalid retry interval \"%s\" (#%d)", retry_list[j*2], j ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); /* do some cleanup */ return 1; } @@ -3584,20 +3584,20 @@ parse_syncrepl_line( if ( lutil_atoi( &si->si_retrynum_init[j], retry_list[j*2+1] ) != 0 || si->si_retrynum_init[j] <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: invalid initial retry number \"%s\" (#%d)", retry_list[j*2+1], j ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); /* do some cleanup */ return 1; } if ( lutil_atoi( &si->si_retrynum[j], retry_list[j*2+1] ) != 0 || si->si_retrynum[j] <= 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: invalid retry number \"%s\" (#%d)", retry_list[j*2+1], j ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); /* do some cleanup */ return 1; } @@ -3618,10 +3618,10 @@ parse_syncrepl_line( if ( lutil_atoi( &si->si_manageDSAit, val ) != 0 || si->si_manageDSAit < 0 || si->si_manageDSAit > 1 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "invalid manageDSAit value \"%s\".\n", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } } else if ( !strncasecmp( c->argv[ i ], SLIMITSTR "=", @@ -3632,10 +3632,10 @@ parse_syncrepl_line( si->si_slimit = 0; } else if ( lutil_atoi( &si->si_slimit, val ) != 0 || si->si_slimit < 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "invalid size limit value \"%s\".\n", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } } else if ( !strncasecmp( c->argv[ i ], TLIMITSTR "=", @@ -3646,10 +3646,10 @@ parse_syncrepl_line( si->si_tlimit = 0; } else if ( lutil_atoi( &si->si_tlimit, val ) != 0 || si->si_tlimit < 0 ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "invalid time limit value \"%s\".\n", val ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return 1; } } else if ( !strncasecmp( c->argv[ i ], SYNCDATASTR "=", @@ -3658,21 +3658,21 @@ parse_syncrepl_line( val = c->argv[ i ] + STRLENOF( SYNCDATASTR "=" ); si->si_syncdata = verb_to_mask( val, datamodes ); } else if ( bindconf_parse( c->argv[i], &si->si_bindconf ) ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: parse_syncrepl_line: " "unable to parse \"%s\"\n", c->argv[ i ] ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } } if ( gots != GOT_ALL ) { - snprintf( c->msg, sizeof( c->msg ), + snprintf( c->cr_msg, sizeof( c->cr_msg ), "Error: Malformed \"syncrepl\" line in slapd config file, missing%s%s%s", gots & GOT_ID ? "" : " "IDSTR, gots & GOT_PROVIDER ? "" : " "PROVIDERSTR, gots & GOT_BASE ? "" : " "SEARCHBASESTR ); - Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 ); return -1; } @@ -3687,14 +3687,14 @@ add_syncrepl( int rc = 0; if ( !( c->be->be_search && c->be->be_add && c->be->be_modify && c->be->be_delete ) ) { - snprintf( c->msg, sizeof(c->msg), "database %s does not support " + snprintf( c->cr_msg, sizeof(c->cr_msg), "database %s does not support " "operations required for syncrepl", c->be->be_type ); - Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); + Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg, 0 ); return 1; } if ( BER_BVISEMPTY( &c->be->be_rootdn ) ) { - strcpy( c->msg, "rootDN must be defined before syncrepl may be used" ); - Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); + strcpy( c->cr_msg, "rootDN must be defined before syncrepl may be used" ); + Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg, 0 ); return 1; } si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) ); -- 2.39.5