Imported Upstream version 4.8.10

This commit is contained in:
Mario Fetka
2021-10-03 11:06:28 +02:00
parent 10dfc9587b
commit 03a8170b15
2361 changed files with 1883897 additions and 338759 deletions

View File

@@ -64,6 +64,7 @@
#define IPAUUID_GENERATE "ipaUuidMagicRegen"
#define IPAUUID_FILTER "ipaUuidFilter"
#define IPAUUID_SCOPE "ipaUuidScope"
#define IPAUUID_EXCLUDE_SUBTREE "ipaUuidExcludeSubtree"
#define IPAUUID_ENFORCE "ipaUuidEnforce"
#define IPAUUID_FEATURE_DESC "IPA UUID"
@@ -91,6 +92,7 @@ struct configEntry {
Slapi_Filter *slapi_filter;
char *generate;
char *scope;
char *exclude_subtree;
bool enforce;
};
@@ -537,6 +539,10 @@ ipauuid_parse_config_entry(Slapi_Entry * e, bool apply)
}
LOG_CONFIG("----------> %s [%s]\n", IPAUUID_SCOPE, entry->scope);
value = slapi_entry_attr_get_charptr(e, IPAUUID_EXCLUDE_SUBTREE);
entry->exclude_subtree = value;
LOG_CONFIG("----------> %s [%s]\n", IPAUUID_EXCLUDE_SUBTREE, entry->exclude_subtree);
entry->enforce = slapi_entry_attr_get_bool(e, IPAUUID_ENFORCE);
LOG_CONFIG("----------> %s [%s]\n",
IPAUUID_ENFORCE, entry->enforce ? "True" : "False");
@@ -640,6 +646,10 @@ ipauuid_free_config_entry(struct configEntry **entry)
slapi_ch_free_string(&e->scope);
}
if (e->exclude_subtree) {
slapi_ch_free_string(&e->exclude_subtree);
}
slapi_ch_free((void **)entry);
}
@@ -901,6 +911,7 @@ static int ipauuid_pre_op(Slapi_PBlock *pb, int modtype)
list != ipauuid_global_config;
list = PR_NEXT_LINK(list)) {
cfgentry = (struct configEntry *) list;
char *current_dn = NULL;
generate = false;
set_attr = false;
@@ -910,14 +921,25 @@ static int ipauuid_pre_op(Slapi_PBlock *pb, int modtype)
cfgentry->attr)) {
continue;
}
/* Current DN may have been reset by
* slapi_pblock_set(pb, SLAPI_ADD_TARGET,..) see below
* need to reread it
*/
current_dn = ipauuid_get_dn(pb);
/* is the entry in scope? */
if (cfgentry->scope) {
if (!slapi_dn_issuffix(dn, cfgentry->scope)) {
if (!slapi_dn_issuffix(current_dn, cfgentry->scope)) {
continue;
}
}
if (cfgentry->exclude_subtree) {
if (slapi_dn_issuffix(current_dn, cfgentry->exclude_subtree)) {
continue;
}
}
/* does the entry match the filter? */
if (cfgentry->slapi_filter) {
Slapi_Entry *test_e = NULL;
@@ -1030,6 +1052,8 @@ static int ipauuid_pre_op(Slapi_PBlock *pb, int modtype)
default:
/* never reached, just silence compiler */
LOG_TRACE("File '%s' line %d: Got unexpected value of modtype:"
"%d\n", __FILE__, __LINE__, modtype);
break;
}
@@ -1090,7 +1114,7 @@ static int ipauuid_pre_op(Slapi_PBlock *pb, int modtype)
ret = LDAP_OPERATIONS_ERROR;
goto done;
}
sdn = slapi_sdn_new_dn_byval(dn);
sdn = slapi_sdn_new_dn_byval(current_dn);
if (!sdn) {
LOG_OOM();
ret = LDAP_OPERATIONS_ERROR;