summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLudwig Krispenz <lkrispen@redhat.com>2015-06-02 09:17:54 +0200
committerPetr Vobornik <pvoborni@redhat.com>2015-06-04 11:42:44 +0200
commit4e05ffa22c4880e393f4770fe64035fa93cb5fd1 (patch)
tree6ebd7240137a58ca68f9e37655aa08cb93abe0c0
parenta931d3edc00f7578223df2afeebdf2da3dd85a68 (diff)
downloadfreeipa-4e05ffa22c4880e393f4770fe64035fa93cb5fd1.tar.gz
freeipa-4e05ffa22c4880e393f4770fe64035fa93cb5fd1.tar.xz
freeipa-4e05ffa22c4880e393f4770fe64035fa93cb5fd1.zip
plugin uses 1 as minimum domain level to become active no calculation based on plugin version
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
-rw-r--r--daemons/ipa-slapi-plugins/topology/topology.h9
-rw-r--r--daemons/ipa-slapi-plugins/topology/topology_cfg.c25
-rw-r--r--daemons/ipa-slapi-plugins/topology/topology_init.c2
-rw-r--r--daemons/ipa-slapi-plugins/topology/topology_util.c4
4 files changed, 12 insertions, 28 deletions
diff --git a/daemons/ipa-slapi-plugins/topology/topology.h b/daemons/ipa-slapi-plugins/topology/topology.h
index 38c2823f5..4135a8ff7 100644
--- a/daemons/ipa-slapi-plugins/topology/topology.h
+++ b/daemons/ipa-slapi-plugins/topology/topology.h
@@ -125,11 +125,6 @@ typedef struct topo_plugin_config {
int activated;
} TopoPluginConf;
-typedef struct ipa_domain_level {
- int major;
- int minor;
-} IpaDomainLevel;
-
#define CONFIG_ATTR_SHARED_BASE "nsslapd-topo-plugin-shared-config-base"
#define CONFIG_ATTR_REPLICA_ROOT "nsslapd-topo-plugin-shared-replica-root"
#define CONFIG_ATTR_SHARED_BINDDNGROUP "nsslapd-topo-plugin-shared-binddngroup"
@@ -158,8 +153,8 @@ int ipa_topo_get_plugin_version_major(void);
int ipa_topo_get_plugin_version_minor(void);
char *ipa_topo_get_domain_level_entry(void);
Slapi_DN *ipa_topo_get_domain_level_entry_dn(void);
-int ipa_topo_get_domain_level_major(void);
-int ipa_topo_get_domain_level_minor(void);
+int ipa_topo_get_domain_level(void);
+int ipa_topo_get_min_domain_level(void);
int ipa_topo_get_plugin_startup_delay(void);
void ipa_topo_set_plugin_id(void *plg_id);
void ipa_topo_set_plugin_active(int state);
diff --git a/daemons/ipa-slapi-plugins/topology/topology_cfg.c b/daemons/ipa-slapi-plugins/topology/topology_cfg.c
index 17493495a..982ad647d 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_cfg.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_cfg.c
@@ -10,7 +10,8 @@
*/
static TopoPluginConf topo_plugin_conf = {0};
static TopoReplicaConf topo_shared_conf = {0};
-static IpaDomainLevel ipa_domain_level = {0,0};
+static int ipa_domain_level = 0;
+static int topo_min_domain_level = 1;
char *ipa_topo_plugin_managed_attrs[] = {
"nsds5ReplicaStripAttrs",
@@ -95,15 +96,15 @@ ipa_topo_get_domain_level_entry_dn(void)
}
int
-ipa_topo_get_domain_level_major(void)
+ipa_topo_get_min_domain_level(void)
{
- return ipa_domain_level.major;
+ return topo_min_domain_level;
}
int
-ipa_topo_get_domain_level_minor(void)
+ipa_topo_get_domain_level(void)
{
- return ipa_domain_level.minor;
+ return ipa_domain_level;
}
char *
@@ -199,22 +200,12 @@ ipa_topo_set_plugin_shared_bindgroup(char *bindgroup)
void
ipa_topo_set_domain_level(char *level)
{
- char *minor;
-
if (level == NULL) {
- ipa_domain_level.major = 0;
- ipa_domain_level.minor = 0;
+ ipa_domain_level = 0;
return;
}
- minor = strchr(level,'.');
- if (minor) {
- *minor = '\0';
- ipa_domain_level.minor = atoi(++minor);
- } else {
- ipa_domain_level.minor = 0;
- }
- ipa_domain_level.major = atoi(level);
+ ipa_domain_level = atoi(level);
}
void
diff --git a/daemons/ipa-slapi-plugins/topology/topology_init.c b/daemons/ipa-slapi-plugins/topology/topology_init.c
index 77e740ea1..af5b8021f 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_init.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_init.c
@@ -264,7 +264,7 @@ ipa_topo_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfte
/* we expose temporarily the domain level in this function, should
* finally be handled in a plugin managing the domain level
*/
- char *level = slapi_ch_smprintf("%d", ipa_topo_get_domain_level_major());
+ char *level = slapi_ch_smprintf("%d", ipa_topo_get_domain_level());
slapi_entry_attr_set_charptr(e, "ipaDomainLevel", level);
slapi_ch_free_string(&version);
slapi_ch_free_string(&level);
diff --git a/daemons/ipa-slapi-plugins/topology/topology_util.c b/daemons/ipa-slapi-plugins/topology/topology_util.c
index f206464a5..d487cfb63 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_util.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_util.c
@@ -110,9 +110,7 @@ ipa_topo_util_get_pluginhost(void)
void
ipa_topo_util_check_plugin_active(void)
{
- if (ipa_topo_get_plugin_version_major() < ipa_topo_get_domain_level_major() ||
- (ipa_topo_get_plugin_version_major() == ipa_topo_get_domain_level_major() &&
- ipa_topo_get_plugin_version_minor() <= ipa_topo_get_domain_level_minor())) {
+ if (ipa_topo_get_min_domain_level() <= ipa_topo_get_domain_level()) {
ipa_topo_set_plugin_active(1);
} else {
ipa_topo_set_plugin_active(0);