(ConfigReply) for the error messages.
#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;
}
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;
#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
}
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;
}
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;
int
dnssrv_back_db_init(
Backend *be,
- ConfigArgs *ca)
+ ConfigReply *cr)
{
return 0;
}
int
dnssrv_back_db_destroy(
Backend *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
return 0;
}
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,
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;
}
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;
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;
static int
ldap_chain_db_close(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
return ldap_chain_db_func( be, 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;
|| 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 <authz>\": "
"\"%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;
}
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 <authz>\": "
"\"<authz>\" 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 <authz>\": "
"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;
}
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 <args>\": "
"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;
}
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 <args>\": "
"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;
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 <args>\": "
"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;
}
int j, err = 0;
if ( flags == NULL ) {
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"idassert-bind <args>\": "
"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;
}
}
} else {
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"idassert-bind <args>\": "
"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;
}
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 <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;
}
|| 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 <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 );
}
}
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 <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;
}
break;
default:
- snprintf( c->msg, sizeof( c->msg),
+ snprintf( c->cr_msg, sizeof( c->cr_msg),
"\"acl-authcDN <DN>\" 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 ) ) {
break;
default:
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"acl-passwd <cred>\" 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 ) ) {
break;
default:
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"idassert-authcDN <DN>\" 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 ) ) {
break;
default:
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"idassert-passwd <cred>\" 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 ) ) {
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 <args>\": "
"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:
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;
}
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;
}
}
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;
}
}
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;
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;
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;
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 <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;
}
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 <n> "
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;
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;
}
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 );
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:
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,
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;
static int
ldap_distproc_db_open(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
return ldap_distproc_db_func( be, db_open );
}
static int
ldap_distproc_db_close(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
return ldap_distproc_db_func( be, 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;
}
int
-ldap_back_db_init( Backend *be, ConfigArgs *ca )
+ldap_back_db_init( Backend *be, ConfigReply *cr )
{
ldapinfo_t *li;
int rc;
}
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;
}
int
-ldap_back_db_close( Backend *be, ConfigArgs *ca )
+ldap_back_db_close( Backend *be, ConfigReply *cr )
{
int rc = 0;
}
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;
}
static int
-ldif_back_db_init( BackendDB *be, ConfigArgs *ca )
+ldif_back_db_init( BackendDB *be, ConfigReply *cr )
{
struct ldif_info *ni;
}
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;
}
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 */
int
meta_back_db_init(
Backend *be,
- ConfigArgs *ca)
+ ConfigReply *cr)
{
metainfo_t *mi;
int i;
int
meta_back_db_open(
Backend *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
metainfo_t *mi = (metainfo_t *)be->be_private;
int
meta_back_db_destroy(
Backend *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
metainfo_t *mi;
int
monitor_back_db_init(
BackendDB *be,
- ConfigArgs *c)
+ ConfigReply *c)
{
int rc;
struct berval dn = BER_BVC( SLAPD_MONITOR_DN ),
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;
int
monitor_back_db_destroy(
BackendDB *be,
- ConfigArgs *ca)
+ ConfigReply *cr)
{
monitor_info_t *mi = ( monitor_info_t * )be->be_private;
}
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;
}
static int
-null_back_db_destroy( Backend *be, ConfigArgs *ca )
+null_back_db_destroy( Backend *be, ConfigReply *cr )
{
free( be->be_private );
return 0;
int
perl_back_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
free( be->be_private );
int
perl_back_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
be->be_private = (PerlBackend *) ch_malloc( sizeof(PerlBackend) );
int
perl_back_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
int count;
}
int
-relay_back_db_init( Backend *be, ConfigArgs *ca)
+relay_back_db_init( Backend *be, ConfigReply *cr)
{
relay_back_info *ri;
}
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;
}
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;
int
shell_back_db_init(
Backend *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
struct shellinfo *si;
int
shell_back_db_destroy(
Backend *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
free( be->be_private );
int
backsql_db_init(
BackendDB *bd,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
backsql_info *bi;
int rc = 0;
int
backsql_db_destroy(
BackendDB *bd,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
backsql_info *bi = (backsql_info*)bd->be_private;
int
backsql_db_open(
BackendDB *bd,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
backsql_info *bi = (backsql_info*)bd->be_private;
SQLHDBC dbh = SQL_NULL_HDBC;
int
backsql_db_close(
BackendDB *bd,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
backsql_info *bi = (backsql_info*)bd->be_private;
}
/* startup a specific backend database */
-int backend_startup_one(Backend *be, ConfigArgs *ca)
+int backend_startup_one(Backend *be, ConfigReply *cr)
{
int rc = 0;
(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 );
int i;
int rc = 0;
BackendInfo *bi;
+ ConfigReply cr={0, ""};
if( ! ( nBackendDB > 0 ) ) {
/* no databases */
/* 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 */
/* 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;
}
const char *type,
BackendDB *b0,
int idx,
- ConfigArgs *ca)
+ ConfigReply *cr)
{
BackendInfo *bi = backend_info(type);
BackendDB *be = b0;
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 ) {
static int
glue_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
glue_db_destroy (
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
glue_db_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
over_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
return over_db_func( be, db_open );
static int
over_db_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinfo *oi = be->bd_info->bi_private;
static int
over_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinfo *oi = be->bd_info->bi_private;
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;
} 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);
}
}
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);
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;
{
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;
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);
}
{
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 */
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] );
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) );
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)
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)
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;
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;
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);
}
}
}
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);
}
}
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 {
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);
}
}
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 {
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);
}
}
#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
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);
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 ))
}
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 )
}
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;
}
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;
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);
}
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 );
}
}
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);
}
}
}
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);
}
}
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);
}
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);
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);
}
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;
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 );
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 ) {
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;
}
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;
/* 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;
}
*/
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;
}
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;
}
}
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;
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;
}
}
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.
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. */
*/
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;
}
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;
};
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;
}
static int
-config_back_db_close( BackendDB *be, ConfigArgs *ca )
+config_back_db_close( BackendDB *be, ConfigReply *cr )
{
CfBackInfo *cfb = be->be_private;
}
static int
-config_back_db_destroy( BackendDB *be, ConfigArgs *ca )
+config_back_db_destroy( BackendDB *be, ConfigReply *cr )
{
CfBackInfo *cfb = be->be_private;
}
static int
-config_back_db_init( BackendDB *be, ConfigArgs* ca )
+config_back_db_init( BackendDB *be, ConfigReply* cr )
{
struct berval dn;
CfBackInfo *cfb;
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;
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 ) {
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;
{
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;
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) {
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);
}
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);
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;
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 */
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 );
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;
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 <suffix>\" 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;
}
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 );
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;
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;
}
static int
accesslog_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
accesslog_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
accesslog_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
auditlog_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
auditlog_db_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
auditlog_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
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 );
}
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 );
}
static int
constraint_close(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *) be->bd_info;
constraint *ap, *a2;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
static int
dds_db_init(
BackendDB *be,
- ConfigArgs *ca)
+ ConfigReply *cr)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
dds_info_t *di;
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;
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;
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;
static int
dyngroup_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
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 );
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 );
}
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 <oc> <URL-ad> [<member-ad>]\": "
"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 <oc> <URL-ad> [<member-ad>]\": "
"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 <oc> <URL-ad> [<member-ad>]\": "
"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 <oc> <URL-ad> [<member-ad>]\": "
"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;
}
}
/* 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 <oc> <URL-ad> [<member-ad>]\": "
"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;
i < c->valx; i++ )
{
if ( *dlip == NULL ) {
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
"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;
} 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: {
oc = oc_find( "groupOfURLs" );
if ( oc == NULL ) {
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"\"dynlist-attrpair <member-ad> <URL-ad>\": "
"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 <member-ad> <URL-ad>\": "
"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 <member-ad> <URL-ad>\": "
"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 <oc> <URL-ad> [<member-ad>]\": "
"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;
}
/* 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 <member-ad> <URL-ad>\": "
"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;
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;
static int
dynlist_db_destroy(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *) be->bd_info;
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
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; i<cm->numattrsets; 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;
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++ = ' ';
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 );
}
*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 )
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;
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;
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;
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 ));
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;
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;
static int
pcache_db_init(
BackendDB *be,
- ConfigArgs *ca)
+ ConfigReply *cr)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
cache_manager *cm;
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;
static int
pcache_db_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
pcache_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
ppolicy_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
static int
ppolicy_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
return overlay_register_control( be, LDAP_CONTROL_PASSWORDPOLICYREQUEST );
static int
ppolicy_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
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;
}
}
static int
refint_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
refint_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
refint_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
refint_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
}
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;
}
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;
}
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;
} 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;
static int
rwm_db_init(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *) be->bd_info;
struct ldaprwmap *rwmap;
static int
rwm_db_destroy(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *) be->bd_info;
int rc = 0;
static int
seqmod_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
seqmod_db_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
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;
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;
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;
static int
syncprov_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
static int
syncprov_db_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
static int
syncprov_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
syncprov_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
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
**
*/
-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;
**
*/
-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;
*/
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;
*/
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;
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;
}
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 );
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;
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;
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;
*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;
}
}
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;
*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;
}
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;
}
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;
}
&& 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;
}
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;
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;
}
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;
}
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;
}
static int
unique_db_init(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
unique_db_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
static int
unique_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
Debug(LDAP_DEBUG_TRACE, "unique_open: overlay initialized\n", 0, 0, 0);
static int
unique_close(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
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 ||
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) );
static int
valsort_db_open(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
return overlay_register_control( be, LDAP_CONTROL_VALSORT );
static int
valsort_destroy(
BackendDB *be,
- ConfigArgs *ca
+ ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *)be->bd_info;
LDAP_BEGIN_DECL
struct config_args_s; /* config.h */
+struct config_reply_s; /* config.h */
/*
* aci.c
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));
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));
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;
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;
}
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;
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;
}
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;
/* 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;
}
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;
/* '\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;
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;
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 "=",
}
}
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,
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 "=",
* 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;
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 "=",
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] );
}
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;
}
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;
}
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 "=",
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 "=",
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 "=",
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;
}
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 ) );