char *global_realm = NULL;
char *ldap_srvtab = "";
char **default_passwd_hash = NULL;
-char *passwd_salt;
-char *logfileName;
struct berval default_search_base = BER_BVNULL;
struct berval default_search_nbase = BER_BVNULL;
static char *replica_pidFile, *replica_argsFile;
static int replicationInterval;
+static char *passwd_salt;
+static char *logfileName;
+
#ifdef LDAP_SLAPI
int slapi_plugins_used = 0;
#endif
&config_generic, "( OLcfgAt:5 NAME 'olcAttributeOptions' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString )", NULL, NULL },
- { "auth-rewrite", NULL, 2, 2, 14,
+ { "authid-rewrite", NULL, 2, 0, 0,
#ifdef SLAP_AUTH_REWRITE
ARG_MAGIC|CFG_REWRITE, &config_generic,
#else
ARG_IGNORED, NULL,
#endif
- "( OLcfgAt:6 NAME 'olcAuthRewrite' "
+ "( OLcfgAt:6 NAME 'olcAuthIDRewrite' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString )", NULL, NULL },
{ "authz-policy", "policy", 2, 2, 0, ARG_STRING|ARG_MAGIC|CFG_AZPOLICY,
#endif
"( OLcfgAt:54 NAME 'olcSaslRealm' "
"SYNTAX OMsDirectoryString )", NULL, NULL },
- { "sasl-regexp", NULL, 2, 2, 0, ARG_MAGIC|CFG_AZREGEXP,
+ { "sasl-regexp", NULL, 3, 3, 0, ARG_MAGIC|CFG_AZREGEXP,
&config_generic, NULL, NULL, NULL },
{ "sasl-secprops", "properties", 2, 2, 0,
#ifdef HAVE_CYRUS_SASL
#endif
"( OLcfgAt:56 NAME 'olcSaslSecProps' "
"SYNTAX OMsDirectoryString )", NULL, NULL },
- { "saslRegexp", NULL, 2, 2, 0, ARG_MAGIC|CFG_AZREGEXP,
+ { "saslRegexp", NULL, 3, 3, 0, ARG_MAGIC|CFG_AZREGEXP,
&config_generic, NULL, NULL, NULL },
{ "schemacheck", "on|off", 2, 2, 0, ARG_ON_OFF|ARG_MAGIC|CFG_CHECK,
&config_generic, "( OLcfgAt:57 NAME 'olcSchemaCheck' "
else
rc = 1;
break;
- case CFG_LIMITS:
+ case CFG_LIMITS: /* FIXME */
rc = 1;
break;
case CFG_RO:
rc = 1;
break;
#ifdef HAVE_CYRUS_SASL
- case CFG_SASLSECP:
+ case CFG_SASLSECP: /* FIXME */
rc = 1;
break;
#endif
case CFG_DEPTH:
c->value_int = c->be->be_max_deref_depth;
break;
- case CFG_OID:
+ case CFG_OID: /* FIXME */
rc = 1;
break;
case CFG_CHECK:
c->value_int = index_substr_if_minlen;
break;
#ifdef SLAPD_MODULES
- case CFG_MODLOAD:
+ case CFG_MODLOAD: /* FIXME */
case CFG_MODPATH:
rc = 1;
break;
#endif
#ifdef LDAP_SLAPI
- case CFG_PLUGIN:
+ case CFG_PLUGIN: /* FIXME */
rc = 1;
break;
#endif
#ifdef SLAP_AUTH_REWRITE
- case CFG_REWRITE:
+ case CFG_REWRITE: /* FIXME */
rc = 1;
break;
#endif
int i, rc = 0;
char *next;
struct slap_limits_set *lim = &c->be->be_def_limit;
- if (c->emit) {
+ if (c->emit) { /* FIXME */
return 1;
}
for(i = 1; i < c->argc; i++) {
char *next;
struct slap_limits_set *lim = &c->be->be_def_limit;
if (c->emit) {
- return 1;
+ return 1; /* FIXME */
}
for(i = 1; i < c->argc; i++) {
if(!strncasecmp(c->argv[i], "time", 4)) {
}
static void
-replica_unparse( struct slap_replica_info *ri, struct berval *bv )
+replica_unparse( struct slap_replica_info *ri, int i, struct berval *bv )
{
int len;
- int i;
char *ptr;
struct berval bc = {0};
+ char numbuf[32];
+
+ len = sprintf(numbuf, "{%d}", i );
- len = strlen( ri->ri_uri ) + STRLENOF("replica uri=");
+ len += strlen( ri->ri_uri ) + STRLENOF("uri=");
if ( ri->ri_nsuffix ) {
for (i=0; !BER_BVISNULL( &ri->ri_nsuffix[i] ); i++) {
len += ri->ri_nsuffix[i].bv_len + STRLENOF(" suffix=\"\"");
bv->bv_val = ch_malloc(len + 1);
bv->bv_len = len;
- ptr = lutil_strcopy( bv->bv_val, "replica uri=" );
+ ptr = lutil_strcopy( bv->bv_val, numbuf );
+ ptr = lutil_strcopy( ptr, "uri=" );
ptr = lutil_strcopy( ptr, ri->ri_uri );
if ( ri->ri_nsuffix ) {
if (c->be->be_replica) {
struct berval bv;
for (i=0;c->be->be_replica[i]; i++) {
- replica_unparse( c->be->be_replica[i], &bv );
+ replica_unparse( c->be->be_replica[i], i, &bv );
ber_bvarray_add( &c->rvalue_vals, &bv );
}
return 0;
{ "never", LDAP_OPT_X_TLS_NEVER },
{ "demand", LDAP_OPT_X_TLS_DEMAND },
{ "try", LDAP_OPT_X_TLS_TRY },
- { "hard", LDAP_OPT_X_TLS_HARD }
+ { "hard", LDAP_OPT_X_TLS_HARD },
{ NULL, 0 }
}, *keys;
switch(c->type) {
for (i=0; keys[i].word; i++) {
if (keys[i].mask == c->value_int) {
c->value_string = ch_strdup( keys[i].word );
- rc = 0;
+ return 0;
}
}
return 1;
bindconf_unparse( &si->si_bindconf, &bc );
ptr = buf;
- ptr += sprintf( ptr, "syncrepl " IDSTR "=%03d " PROVIDERSTR "=%s",
+ ptr += sprintf( ptr, IDSTR "=%03d " PROVIDERSTR "=%s",
si->si_rid, si->si_provideruri.bv_val );
if ( !BER_BVISNULL( &bc )) {
ptr = lutil_strcopy( ptr, bc.bv_val );
#ifdef HAVE_CYRUS_SASL
void *defaults;
- if ( si->si_secprops != NULL ) {
+ if ( si->si_bindconf.sb_secprops != NULL ) {
rc = ldap_set_option( si->si_ld,
- LDAP_OPT_X_SASL_SECPROPS, si->si_secprops);
+ LDAP_OPT_X_SASL_SECPROPS, si->si_bindconf.sb_secprops);
if( rc != LDAP_OPT_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option "
"(%s,SECPROPS,\"%s\") failed!\n",
- si->si_provideruri.bv_val, si->si_secprops, 0 );
+ si->si_provideruri.bv_val, si->si_bindconf.sb_secprops, 0 );
goto done;
}
}
- defaults = lutil_sasl_defaults( si->si_ld, si->si_saslmech,
- si->si_realm, si->si_authcId, si->si_passwd, si->si_authzId );
+ defaults = lutil_sasl_defaults( si->si_ld, si->si_bindconf.sb_saslmech,
+ si->si_bindconf.sb_realm, si->si_bindconf.sb_authcId,
+ si->si_bindconf.sb_cred, si->si_bindconf.sb_authzId );
rc = ldap_sasl_interactive_bind_s( si->si_ld,
- si->si_binddn,
- si->si_saslmech,
+ si->si_bindconf.sb_binddn,
+ si->si_bindconf.sb_saslmech,
NULL, NULL,
LDAP_SASL_QUIET,
lutil_sasl_interact,
/* FIXME (see above comment) */
/* if Kerberos credentials cache is not active, retry */
- if ( strcmp( si->si_saslmech, "GSSAPI" ) == 0 &&
+ if ( strcmp( si->si_bindconf.sb_saslmech, "GSSAPI" ) == 0 &&
rc == LDAP_LOCAL_ERROR )
{
rc = LDAP_SERVER_DOWN;
#endif
} else {
- rc = ldap_bind_s( si->si_ld,
- si->si_bindconf.sb_binddn, si->si_bindconf.sb_cred, si->si_bindconf.sb_method );
+ rc = ldap_bind_s( si->si_ld, si->si_bindconf.sb_binddn,
+ si->si_bindconf.sb_cred, si->si_bindconf.sb_method );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "do_syncrep1: "
"ldap_bind_s failed (%d)\n", rc, 0, 0 );