/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2005 The OpenLDAP Foundation.
+ * Copyright 2005-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
static struct berval config_rdn = BER_BVC("cn=config");
static struct berval schema_rdn = BER_BVC("cn=schema");
-#define SLAP_X_ORDERED_FMT "{%d}"
-
#ifdef SLAPD_MODULES
typedef struct modpath_s {
struct modpath_s *mp_next;
int cb_use_ldif;
} CfBackInfo;
-/* These do nothing in slapd, they're kept only to make them
- * editable here.
- */
-static char *replica_pidFile, *replica_argsFile;
-static int replicationInterval;
-
static char *passwd_salt;
static char *logfileName;
#ifdef SLAP_AUTH_REWRITE
CFG_DIT,
CFG_ATTR,
CFG_ATOPT,
+ CFG_REPLICA_ARGSFILE,
+ CFG_REPLICA_PIDFILE,
+ CFG_REPLICATIONINTERVAL,
CFG_REPLOG,
CFG_ROOTDSE,
CFG_LOGFILE,
{ "OLcfgDbOc", "OLcfgOc:2" },
{ "OLcfgOvOc", "OLcfgOc:3" },
{ "OMsyn", "1.3.6.1.4.1.1466.115.121.1" },
- { "OMsInteger", "OMsyn:27" },
{ "OMsBoolean", "OMsyn:7" },
{ "OMsDN", "OMsyn:12" },
{ "OMsDirectoryString", "OMsyn:15" },
+ { "OMsInteger", "OMsyn:27" },
+ { "OMsOID", "OMsyn:38" },
{ "OMsOctetString", "OMsyn:40" },
{ NULL, NULL }
};
* Backend/Database registry
*
* OLcfg{Bk|Db}{Oc|At}:0 -> common
- * OLcfg{Bk|Db}{Oc|At}:1 -> bdb
- * OLcfg{Bk|Db}{Oc|At}:2 -> ldif
- * OLcfg{Bk|Db}{Oc|At}:3 -> ldap?
+ * OLcfg{Bk|Db}{Oc|At}:1 -> back-bdb(/back-hdb)
+ * OLcfg{Bk|Db}{Oc|At}:2 -> back-ldif
+ * OLcfg{Bk|Db}{Oc|At}:3 -> back-ldap
*/
/*
* OLcfgOv{Oc|At}:3 -> chain
* OLcfgOv{Oc|At}:4 -> accesslog
* OLcfgOv{Oc|At}:5 -> valsort
- * OLcfgOv{Oc|At}:6 -> smbk5pwd (use a separate arc for contrib?)
+ * (FIXME: separate arc for contribware?)
+ * OLcfgOv{Oc|At}:6 -> smbk5pwd
+ * OLcfgOv{Oc|At}:7 -> distproc
+ * OLcfgOv{Oc|At}:8 -> dynlist
+ * OLcfgOv{Oc|At}:9 -> dds
*/
/* alphabetical ordering */
&config_generic, "( OLcfgGlAt:5 NAME 'olcAttributeOptions' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString )", NULL, NULL },
- { "attribute", "attribute", 2, 0, 9,
+ { "attribute", "attribute", 2, 0, STRLENOF( "attribute" ),
ARG_PAREN|ARG_MAGIC|CFG_ATTR|ARG_NO_DELETE|ARG_NO_INSERT,
&config_generic, "( OLcfgGlAt:4 NAME 'olcAttributeTypes' "
"DESC 'OpenLDAP attributeTypes' "
{ "replica", "host or uri", 2, 0, 0, ARG_DB|ARG_MAGIC,
&config_replica, "( OLcfgDbAt:0.7 NAME 'olcReplica' "
"SUP labeledURI X-ORDERED 'VALUES' )", NULL, NULL },
- { "replica-argsfile", NULL, 0, 0, 0, ARG_STRING,
- &replica_argsFile, "( OLcfgGlAt:43 NAME 'olcReplicaArgsFile' "
+ { "replica-argsfile", NULL, 0, 0, 0, ARG_MAY_DB|ARG_MAGIC|ARG_STRING|CFG_REPLICA_ARGSFILE,
+ &config_generic, "( OLcfgGlAt:43 NAME 'olcReplicaArgsFile' "
"SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
- { "replica-pidfile", NULL, 0, 0, 0, ARG_STRING,
- &replica_pidFile, "( OLcfgGlAt:44 NAME 'olcReplicaPidFile' "
+ { "replica-pidfile", NULL, 0, 0, 0, ARG_MAY_DB|ARG_MAGIC|ARG_STRING|CFG_REPLICA_PIDFILE,
+ &config_generic, "( OLcfgGlAt:44 NAME 'olcReplicaPidFile' "
"SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
- { "replicationInterval", NULL, 0, 0, 0, ARG_INT,
- &replicationInterval, "( OLcfgGlAt:45 NAME 'olcReplicationInterval' "
+ { "replicationInterval", NULL, 0, 0, 0, ARG_MAY_DB|ARG_MAGIC|ARG_INT|CFG_REPLICATIONINTERVAL,
+ &config_generic, "( OLcfgGlAt:45 NAME 'olcReplicationInterval' "
"SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
{ "replogfile", "filename", 2, 2, 0, ARG_MAY_DB|ARG_MAGIC|ARG_STRING|CFG_REPLOG,
&config_generic, "( OLcfgGlAt:46 NAME 'olcReplogFile' "
"olcLogLevel $ "
"olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ "
"olcPluginLogFile $ olcReadOnly $ olcReferral $ "
- "olcReplicaPidFile $ olcReplicaArgsFile $ olcReplicationInterval $ "
"olcReplogFile $ olcRequires $ olcRestrict $ olcReverseLookup $ "
"olcRootDSE $ "
"olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ "
"MUST olcDatabase "
"MAY ( olcSuffix $ olcSubordinate $ olcAccess $ olcLastMod $ olcLimits $ "
"olcMaxDerefDepth $ olcPlugin $ olcReadOnly $ olcReplica $ "
+ "olcReplicaArgsFile $ olcReplicaPidFile $ olcReplicationInterval $ "
"olcReplogFile $ olcRequires $ olcRestrict $ olcRootDN $ olcRootPW $ "
"olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSyncrepl $ "
"olcTimeLimit $ olcUpdateDN $ olcUpdateRef ) )",
break;
}
bv.bv_val = buf + bv.bv_len;
- limits_unparse( c->be->be_limits[i], &bv );
+ limits_unparse( c->be->be_limits[i], &bv,
+ sizeof( buf ) - ( bv.bv_val - buf ) );
bv.bv_len += bv.bv_val - buf;
bv.bv_val = buf;
value_add_one( &c->rvalue_vals, &bv );
rc = 1;
}
break;
+ case CFG_ATOPT:
+ ad_unparse_options( &c->rvalue_vals );
+ break;
case CFG_OC: {
ConfigFile *cf = c->private;
if ( !cf )
rc = (!i);
break;
}
+ case CFG_REPLICA_ARGSFILE:
+ if ( c->be->be_replica_argsfile )
+ c->value_string = ch_strdup( c->be->be_replica_argsfile );
+ break;
+ case CFG_REPLICA_PIDFILE:
+ if ( c->be->be_replica_pidfile )
+ c->value_string = ch_strdup( c->be->be_replica_pidfile );
+ break;
+ case CFG_REPLICATIONINTERVAL:
+ if ( c->be->be_replicationinterval > 0 ) {
+ c->value_int = c->be->be_replicationinterval;
+ } else {
+ rc = 1;
+ }
+ break;
case CFG_REPLOG:
if ( c->be->be_replogfile )
c->value_string = ch_strdup( c->be->be_replogfile );
passwd_salt = NULL;
break;
+ case CFG_REPLICA_ARGSFILE:
+ ch_free( c->be->be_replica_argsfile );
+ c->be->be_replica_argsfile = NULL;
+ break;
+
+ case CFG_REPLICA_PIDFILE:
+ ch_free( c->be->be_replica_pidfile );
+ c->be->be_replica_pidfile = NULL;
+ break;
+
+ case CFG_REPLICATIONINTERVAL:
+ c->be->be_replicationinterval = 0;
+ break;
+
case CFG_REPLOG:
ch_free( c->be->be_replogfile );
c->be->be_replogfile = NULL;
break;
case CFG_THREADS:
+ if ( c->value_int > 2 * SLAP_MAX_WORKER_THREADS ) {
+ snprintf( c->msg, sizeof( c->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 );
+ }
if ( slapMode & SLAP_SERVER_MODE )
ldap_pvt_thread_pool_maxthreads(&connection_pool, c->value_int);
connection_pool_max = c->value_int; /* save for reference */
break;
case CFG_ACL:
- if ( parse_acl(c->be, c->fname, c->lineno, c->argc, c->argv, c->valx) ) {
+ if ( parse_acl(c->be, c->fname, c->lineno, c->argc, c->argv, c->valx ) ) {
return 1;
}
break;
+ case CFG_REPLICA_ARGSFILE:
+ if(SLAP_MONITOR(c->be)) {
+ Debug(LDAP_DEBUG_ANY, "%s: "
+ "\"replica-argsfile\" should not be used "
+ "inside monitor database\n",
+ c->log, 0, 0);
+ /* FIXME: should this be an error? */
+ return(0);
+ }
+
+ if ( c->be->be_replica_argsfile != NULL ) {
+ /* FIXME: error? */
+ Debug(LDAP_DEBUG_ANY, "%s: "
+ "\"replica-argsfile\" already provided; "
+ "replacing \"%s\" with \"%s\".\n",
+ c->log, c->be->be_replica_argsfile, c->value_string );
+ ch_free( c->be->be_replica_argsfile );
+ }
+
+ c->be->be_replica_argsfile = c->value_string;
+ break;
+
+ case CFG_REPLICA_PIDFILE:
+ if(SLAP_MONITOR(c->be)) {
+ Debug(LDAP_DEBUG_ANY, "%s: "
+ "\"replica-pidfile\" should not be used "
+ "inside monitor database\n",
+ c->log, 0, 0);
+ /* FIXME: should this be an error? */
+ return(0);
+ }
+
+ if ( c->be->be_replica_pidfile != NULL ) {
+ /* FIXME: error? */
+ Debug(LDAP_DEBUG_ANY, "%s: "
+ "\"replica-pidfile\" already provided; "
+ "replacing \"%s\" with \"%s\".\n",
+ c->log, c->be->be_replica_pidfile, c->value_string );
+ ch_free( c->be->be_replica_pidfile );
+ }
+
+ c->be->be_replica_pidfile = c->value_string;
+ break;
+
+ case CFG_REPLICATIONINTERVAL:
+ if(SLAP_MONITOR(c->be)) {
+ Debug(LDAP_DEBUG_ANY, "%s: "
+ "\"replicationinterval\" should not be used "
+ "inside monitor database\n",
+ c->log, 0, 0);
+ /* FIXME: should this be an error? */
+ return(0);
+ }
+
+ c->be->be_replicationinterval = c->value_int;
+ break;
+
case CFG_REPLOG:
if(SLAP_MONITOR(c->be)) {
Debug(LDAP_DEBUG_ANY, "%s: "
"\"replogfile\" should not be used "
"inside monitor database\n",
c->log, 0, 0);
- return(0); /* FIXME: should this be an error? */
+ /* FIXME: should this be an error? */
+ return(0);
+ }
+
+ if ( c->be->be_replogfile != NULL ) {
+ /* FIXME: error? */
+ Debug(LDAP_DEBUG_ANY, "%s: "
+ "\"replogfile\" already provided; "
+ "replacing \"%s\" with \"%s\".\n",
+ c->log, c->be->be_replogfile, c->value_string );
+ ch_free( c->be->be_replogfile );
}
c->be->be_replogfile = c->value_string;
default:
- Debug( SLAPD_DEBUG_CONFIG_ERROR,
- "%s: unknown CFG_TYPE %d"
- SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+ Debug( LDAP_DEBUG_ANY,
+ "%s: unknown CFG_TYPE %d.\n",
c->log, c->type, 0 );
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
}
return(0);
static int
config_sizelimit(ConfigArgs *c) {
int i, rc = 0;
- char *next;
struct slap_limits_set *lim = &c->be->be_def_limit;
if (c->op == SLAP_CONFIG_EMIT) {
char buf[8192];
struct berval bv;
bv.bv_val = buf;
bv.bv_len = 0;
- limits_unparse_one( lim, SLAP_LIMIT_SIZE, &bv );
+ limits_unparse_one( lim, SLAP_LIMIT_SIZE, &bv, sizeof( buf ) );
if ( !BER_BVISEMPTY( &bv ))
value_add_one( &c->rvalue_vals, &bv );
else
static int
config_timelimit(ConfigArgs *c) {
int i, rc = 0;
- char *next;
struct slap_limits_set *lim = &c->be->be_def_limit;
if (c->op == SLAP_CONFIG_EMIT) {
char buf[8192];
struct berval bv;
bv.bv_val = buf;
bv.bv_len = 0;
- limits_unparse_one( lim, SLAP_LIMIT_TIME, &bv );
+ limits_unparse_one( lim, SLAP_LIMIT_TIME, &bv, sizeof( buf ) );
if ( !BER_BVISEMPTY( &bv ))
value_add_one( &c->rvalue_vals, &bv );
else
}
if(c->argv[1][0] == '-' && overlay_config(c->be, &c->argv[1][1])) {
/* log error */
- Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: (optional) %s overlay \"%s\" configuration failed"
- SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+ Debug( LDAP_DEBUG_ANY,
+ "%s: (optional) %s overlay \"%s\" configuration failed.\n",
c->log, c->be == frontendDB ? "global " : "", &c->argv[1][1]);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
} else if(overlay_config(c->be, c->argv[1])) {
return(1);
}
int i = c->valx;
ch_free( c->be->be_suffix[i].bv_val );
ch_free( c->be->be_nsuffix[i].bv_val );
- for (; c->be->be_suffix[i].bv_val; i++) {
+ do {
c->be->be_suffix[i] = c->be->be_suffix[i+1];
c->be->be_nsuffix[i] = c->be->be_nsuffix[i+1];
- }
+ i++;
+ } while ( !BER_BVISNULL( &c->be->be_suffix[i] ) );
}
return 0;
}
ndn = c->value_ndn;
tbe = select_backend(&ndn, 0, 0);
if(tbe == c->be) {
- Debug( SLAPD_DEBUG_CONFIG_ERROR,
- "%s: suffix already served by this backend!"
- SLAPD_CONF_UNKNOWN_IGNORED ".\n",
+ Debug( LDAP_DEBUG_ANY, "%s: suffix already served by this backend!.\n",
c->log, 0, 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
free(pdn.bv_val);
free(ndn.bv_val);
} else if(tbe) {
{ BER_BVC("modrdn"), 0 },
{ BER_BVC("delete"), SLAP_RESTRICT_OP_DELETE },
{ BER_BVC("search"), SLAP_RESTRICT_OP_SEARCH },
- { BER_BVC("compare"), SLAP_RESTRICT_OP_COMPARE },
+ { BER_BVC("compare"), SLAP_RESTRICT_OP_COMPARE },
{ BER_BVC("read"), SLAP_RESTRICT_OP_READS },
{ BER_BVC("write"), SLAP_RESTRICT_OP_WRITES },
{ BER_BVC("extended"), SLAP_RESTRICT_OP_EXTENDED },
{ BER_BVC("extended=" LDAP_EXOP_MODIFY_PASSWD ), SLAP_RESTRICT_EXOP_MODIFY_PASSWD },
{ BER_BVC("extended=" LDAP_EXOP_X_WHO_AM_I ), SLAP_RESTRICT_EXOP_WHOAMI },
{ BER_BVC("extended=" LDAP_EXOP_X_CANCEL ), SLAP_RESTRICT_EXOP_CANCEL },
+ { BER_BVC("all"), SLAP_RESTRICT_OP_ALL },
{ BER_BVNULL, 0 }
};
{ BER_BVC("bind_anon_cred"), SLAP_ALLOW_BIND_ANON_CRED },
{ BER_BVC("bind_anon_dn"), SLAP_ALLOW_BIND_ANON_DN },
{ BER_BVC("update_anon"), SLAP_ALLOW_UPDATE_ANON },
+ { BER_BVC("proxy_authz_anon"), SLAP_ALLOW_PROXY_AUTHZ_ANON },
{ BER_BVNULL, 0 }
};
if (c->op == SLAP_CONFIG_EMIT) {
{ BER_BVC("Stats2"), LDAP_DEBUG_STATS2 },
{ BER_BVC("Shell"), LDAP_DEBUG_SHELL },
{ BER_BVC("Parse"), LDAP_DEBUG_PARSE },
+#if 0 /* no longer used (nor supported) */
{ BER_BVC("Cache"), LDAP_DEBUG_CACHE },
{ BER_BVC("Index"), LDAP_DEBUG_INDEX },
+#endif
{ BER_BVC("Sync"), LDAP_DEBUG_SYNC },
{ BER_BVC("None"), LDAP_DEBUG_NONE },
{ BER_BVNULL, 0 }
static int
config_loglevel(ConfigArgs *c) {
int i;
- char *next;
if ( loglevel_ops == NULL ) {
loglevel_init();
}
char *
-anlist_unparse( AttributeName *an, char *ptr ) {
+anlist_unparse( AttributeName *an, char *ptr, ber_len_t buflen ) {
int comma = 0;
+ char *start = ptr;
for (; !BER_BVISNULL( &an->an_name ); an++) {
+ /* if buflen == 0, assume the buffer size has been
+ * already checked otherwise */
+ if ( buflen > 0 && buflen - ( ptr - start ) < comma + an->an_name.bv_len ) return NULL;
if ( comma ) *ptr++ = ',';
ptr = lutil_strcopy( ptr, an->an_name.bv_val );
comma = 1;
ptr = lutil_strcopy( ptr, " attrs" );
if ( ri->ri_exclude ) *ptr++ = '!';
*ptr++ = '=';
- ptr = anlist_unparse( ri->ri_attrs, ptr );
+ ptr = anlist_unparse( ri->ri_attrs, ptr, 0 );
}
}
} else if(!strncasecmp(c->argv[i], "suffix=", STRLENOF( "suffix="))) {
switch(add_replica_suffix(c->be, nr, c->argv[i] + STRLENOF("suffix="))) {
case 1:
- Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
- "suffix \"%s\" in \"replica\" line is not valid for backend"
- SLAPD_CONF_UNKNOWN_IGNORED ".\n",
- c->log, c->argv[i] + STRLENOF("suffix="), 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
+ Debug( LDAP_DEBUG_ANY, "%s: "
+ "suffix \"%s\" in \"replica\" line is not valid for backend.\n",
+ c->log, c->argv[i] + STRLENOF("suffix="), 0);
return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
break;
case 2:
- Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
- "unable to normalize suffix in \"replica\" line"
- SLAPD_CONF_UNKNOWN_IGNORED ".\n",
- c->log, 0, 0);
-#ifdef SLAPD_CONF_UNKNOWN_BAILOUT
+ Debug( LDAP_DEBUG_ANY, "%s: "
+ "unable to normalize suffix in \"replica\" line.\n",
+ c->log, 0, 0);
return 1;
-#endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
break;
}
BER_BVZERO( &c->value_dn );
BER_BVZERO( &c->value_ndn );
- SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SLURP_SHADOW);
- return(0);
+ return config_slurp_shadow( c );
+}
+
+int
+config_shadow( ConfigArgs *c, int flag )
+{
+ char *notallowed = NULL;
+
+ if ( c->be == frontendDB ) {
+ notallowed = "frontend";
+
+ } else if ( SLAP_MONITOR(c->be) ) {
+ notallowed = "monitor";
+
+ } else if ( SLAP_CONFIG(c->be) ) {
+ notallowed = "config";
+ }
+
+ if ( notallowed != NULL ) {
+ Debug( LDAP_DEBUG_ANY, "%s: %s database cannot be shadow.\n", c->log, notallowed, 0 );
+ return 1;
+ }
+
+ SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | flag);
+
+ return 0;
}
static int
dnRdn( &e->e_name, &rdn );
ptr1 = ber_bvchr( &e->e_name, '{' );
if ( ptr1 && ptr1 - e->e_name.bv_val < rdn.bv_len ) {
+ char *next;
ptr2 = strchr( ptr1, '}' );
if (!ptr2 || ptr2 - e->e_name.bv_val > rdn.bv_len)
return LDAP_NAMING_VIOLATION;
if ( ptr2-ptr1 == 1)
return LDAP_NAMING_VIOLATION;
gotindex = 1;
- if ( lutil_atoi( &index, ptr1 + 1 ) != 0 ) {
+ index = strtol( ptr1 + 1, &next, 10 );
+ if ( next == ptr1 + 1 || next[ 0 ] != '}' ) {
return LDAP_NAMING_VIOLATION;
}
if ( index < 0 ) {
* These entries can have auto-assigned indexes (appended to the end)
* but only the other types support auto-renumbering of siblings.
*/
- rc = check_name_index( last, colst[0]->co_type, e, rs, renum );
- if ( rc )
- goto done;
+ {
+ int renumber = renum ? *renum : 0;
+ rc = check_name_index( last, colst[0]->co_type, e, rs, renum );
+ if ( rc ) {
+ goto done;
+ }
+ if ( renum && *renum && renumber == -1 ) {
+ snprintf( ca->msg, sizeof( ca->msg ),
+ "operation requires sibling renumbering" );
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ goto done;
+ }
+ }
init_config_argv( ca );
* 4) store entry in underlying database
* 5) perform any necessary renumbering
*/
+ /* NOTE: by now we do not accept adds that require renumbering */
+ renumber = -1;
rs->sr_err = config_add_internal( cfb, op->ora_e, &ca, rs, &renumber );
if ( rs->sr_err != LDAP_SUCCESS ) {
rs->sr_text = ca.msg;
- } else if ( cfb->cb_use_ldif ) {
+ goto out2;
+ }
+
+ if ( cfb->cb_use_ldif ) {
BackendDB *be = op->o_bd;
slap_callback sc = { NULL, slap_null_cb, NULL, NULL };
struct berval dn, ndn;
op->o_dn = dn;
op->o_ndn = ndn;
}
+
if ( renumber ) {
+ /* TODO */
}
+out2:;
ldap_pvt_thread_pool_resume( &connection_pool );
-out:
+out:;
send_ldap_result( op, rs );
return rs->sr_err;
}
ca->bi = ce->ce_bi;
ca->private = ce->ce_private;
ca->ca_entry = e;
+ ca->fname = "slapd";
strcpy( ca->log, "back-config" );
for (ml = op->orm_modlist; ml; ml=ml->sml_next) {
}
ldap_pvt_thread_pool_pause( &connection_pool );
+ rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+ rs->sr_text = "renaming not implemented yet within naming context";
+
ldap_pvt_thread_pool_resume( &connection_pool );
out:
send_ldap_result( op, rs );
for (i=0;ct[i].name;i++) {
if (ct[i].ad == (*at)->sat_ad) {
rc = config_get_vals(&ct[i], c);
- if (rc == LDAP_SUCCESS) {
+ /* NOTE: tolerate that config_get_vals()
+ * returns success with no values */
+ if (rc == LDAP_SUCCESS && c->rvalue_vals != NULL ) {
if ( c->rvalue_nvals )
attr_merge(e, ct[i].ad, c->rvalue_vals,
c->rvalue_nvals);
struct berval rdn;
Entry *e, *parent;
CfEntryInfo *ce, *ceparent;
- int i;
+ int i, unsupp = 0;
BackendInfo *bi;
ConfigArgs c;
Connection conn = {0};
c.line = 0;
LDAP_STAILQ_FOREACH( bi, &backendInfo, bi_next) {
- if (!bi->bi_cf_ocs) continue;
+ if (!bi->bi_cf_ocs) {
+ /* If it only supports the old config mech, complain. */
+ if ( bi->bi_config ) {
+ Debug( LDAP_DEBUG_ANY,
+ "WARNING: No dynamic config support for backend %s.\n",
+ bi->bi_type, 0, 0 );
+ unsupp++;
+ }
+ continue;
+ }
if (!bi->bi_private) continue;
rdn.bv_val = c.log;
} else {
bi = be->bd_info;
}
+
+ /* If this backend supports the old config mechanism, but not
+ * the new mech, complain.
+ */
+ if ( !be->be_cf_ocs && bi->bi_db_config ) {
+ Debug( LDAP_DEBUG_ANY,
+ "WARNING: No dynamic config support for database %s.\n",
+ bi->bi_type, 0, 0 );
+ unsupp++;
+ }
rdn.bv_val = c.log;
rdn.bv_len = snprintf(rdn.bv_val, sizeof( c.log ),
"%s=" SLAP_X_ORDERED_FMT "%s", cfAd_database->ad_cname.bv_val,
int j;
for (j=0,on=oi->oi_list; on; j++,on=on->on_next) {
+ if ( on->on_bi.bi_db_config && !on->on_bi.bi_cf_ocs ) {
+ Debug( LDAP_DEBUG_ANY,
+ "WARNING: No dynamic config support for overlay %s.\n",
+ on->on_bi.bi_type, 0, 0 );
+ unsupp++;
+ }
rdn.bv_val = c.log;
rdn.bv_len = snprintf(rdn.bv_val, sizeof( c.log ),
"%s=" SLAP_X_ORDERED_FMT "%s",
if ( thrctx )
ldap_pvt_thread_pool_context_reset( thrctx );
+ if ( unsupp && cfb->cb_use_ldif ) {
+ Debug( LDAP_DEBUG_ANY, "\nWARNING: The converted cn=config "
+ "directory is incomplete and may not work.\n\n", 0, 0, 0 );
+ }
+
return 0;
}
NULL
};
+ /* Make sure we don't exceed the bits reserved for userland */
+ config_check_userland( CFG_LAST );
+
bi->bi_controls = controls;
bi->bi_open = 0;
bi->bi_tool_entry_get = config_tool_entry_get;
bi->bi_tool_entry_put = config_tool_entry_put;
- /* Make sure we don't exceed the bits reserved for userland */
- assert( ( ( CFG_LAST - 1 ) & ARGS_USERLAND ) == ( CFG_LAST - 1 ) );
-
argv[3] = NULL;
for (i=0; OidMacros[i].name; i++ ) {
argv[1] = OidMacros[i].name;