mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
committed by
Petr Vobornik
parent
a931d3edc0
commit
4e05ffa22c
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user