# `-S flag=value`.
#
migrate {
+ #
+ # tmpl_tokenize_all_nested:: Create all internal "tmpl" data
+ # structures as using nested structures instead of flat ones.
+ #
+ tmpl_tokenize_all_nested = false
+
#
# rewrite_update:: Rewrite old `update` sections to use the new
# "edit" code.
* Migration configuration.
*/
static const CONF_PARSER migrate_config[] = {
+ { FR_CONF_OFFSET("tmpl_tokenize_all_nested", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, tmpl_tokenize_all_nested) },
{ FR_CONF_OFFSET("rewrite_update", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, rewrite_update) },
{ FR_CONF_OFFSET("forbid_update", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, forbid_update) },
}
static fr_table_num_ordered_t config_arg_table[] = {
+ { L("tmpl_tokenize_all_nested"), offsetof(main_config_t, tmpl_tokenize_all_nested) },
{ L("rewrite_update"), offsetof(main_config_t, rewrite_update) },
{ L("forbid_update"), offsetof(main_config_t, forbid_update) },
};
/*
* Migration tools
*/
+ bool tmpl_tokenize_all_nested; //!< tmpl_tokenize will create nested tmpls instead of flat ones
bool rewrite_update; //!< rewrite "update" to be new edit sections
bool forbid_update; //!< forbid "update" sections
};
case FR_TYPE_VSA:
is_union:
/*
- * These structural types are always nested. Both for parenting, and for
- * namespace.
+ * Omit nesting types where the relationship is already
+ * described by the dictionaries and there's no filter.
+ *
+ * These attribute references would just use additional
+ * memory for no real purpose.
+ *
+ * Because we pre-allocate an attribute reference in
+ * each tmpl talloc pool, unless the attribute
+ * reference list contains a group, there's no performance
+ * penalty in repeatedly allocating and freeing this ar.
+ *
+ * Flatten / nested migration hack. :(
+ */
+ if (1 && main_config && main_config->tmpl_tokenize_all_nested) {
+ our_parent = da; /* Only update the parent if we're not stripping */
+
+ } else if (ar_filter_is_none(ar) && ar_is_normal(ar)) {
+ TALLOC_FREE(ar);
+ } else {
+ our_parent = da; /* Only update the parent if we're not stripping */
+ }
+
+ /*
+ * The child might not go into the parent list, but the child definitely is in
+ * the parents namespace.
*/
- namespace = our_parent = da;
+ namespace = da;
break;
default:
allow_vulnerable_openssl = yes
}
+migrate {
+ tmpl_tokenize_all_nested = true
+}
+
modules {
$INCLUDE ${raddb}/mods-enabled/always
allow_vulnerable_openssl = yes
}
+migrate {
+ tmpl_tokenize_all_nested = true
+}
+
policy {
files.authorize {
if (&User-Name == "bob") {
$(OUTPUT)/${1}: NEW_COND=
else ifneq "$(findstring ${1}, $(KEYWORD_UPDATE_REWRITE_TESTS))" ""
-$(OUTPUT)/${1}: NEW_COND=-S rewrite_update=yes
+$(OUTPUT)/${1}: NEW_COND=-S rewrite_update=yes -S tmpl_tokenize_all_nested=yes
else
-$(OUTPUT)/${1}: NEW_COND=-S forbid_update=yes
+$(OUTPUT)/${1}: NEW_COND=-S forbid_update=yes -S tmpl_tokenize_all_nested=yes
ifeq "${1}" "mschap"
$(OUTPUT)/${1}: $(BUILD_DIR)/lib/local/rlm_mschap.la $(BUILD_DIR)/lib/rlm_mschap.la
}
#
-# Must be nested
+# Allow old-style, and with -S tmpl_tokenize_all_nested=yes
#
-if !(&Tmp-String-4 == 'Password = { Cleartext = "hello" }') {
+if !((&Tmp-String-4 == 'Password.Cleartext = "hello"') ||
+ (&Tmp-String-4 == 'Password = { Cleartext = "hello" }')) {
test_fail
}
allow_vulnerable_openssl = yes
}
+# Only during migration
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+
global {
ldap {
ldap_debug = 0x0801
allow_vulnerable_openssl = yes
}
+# Only during migration
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+
global {
ldap {
ldap_debug = 0x0801
allow_vulnerable_openssl = yes
}
+# Only during migration
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+
global {
ldap {
ldap_debug = 0x0801
+# Needed during migration to nested attributes
+# to check TLS-Certificate.Issuer
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+# Needed during migration to nested attributes
+# to check TLS-Certificate.Issuer
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+# Needed during migration to nested attributes
+# to check TLS-Certificate.Issuer
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+# Needed during migration to nested attributes
+# to check TLS-Certificate.Issuer
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
+# Needed during migration to nested attributes
+# to check TLS-Certificate.Issuer
+migrate {
+ tmpl_tokenize_all_nested = yes
+}
allow_vulnerable_openssl = yes
}
+#
+# @todo - set all of these flags!
+#
+#migrate {
+# tmpl_tokenize_all_nested = true
+# forbid_update = true
+#}
+
delete_from_radacct = "DELETE FROM radcheck WHERE AcctSessionId ="
delete_from_radcheck = "DELETE FROM radcheck WHERE username ="
delete_from_radreply = "DELETE FROM radreply WHERE username ="
allow_core_dumps = yes
}
+migrate {
+ tmpl_tokenize_all_nested = true
+}
+
modules {
$INCLUDE ${raddb}/mods-enabled/always