return slen;
}
- /*
- * Ensure that everything is resolved otherwise we have
- * no idea what to do.
- */
- if (head->flags.needs_resolving &&
- (xlat_resolve(head, &(xlat_res_rules_t){ .allow_unresolved = false }) < 0)) {
- talloc_free(head);
- return -1;
- }
-
/*
* Create ephemeral instance data for the xlat
*/
if (xlat_instantiate_ephemeral(head, el) < 0) {
- fr_strerror_const("Failed performing ephemeral instantiation for xlat");
talloc_free(head);
return 0;
}
{
int ret;
+ /*
+ * The caller MAY resolve it, or may not. If the caller
+ * hasn't resolved it, then we can't allow any unresolved
+ * functions or attributes.
+ */
+ if (head->flags.needs_resolving) {
+ if (xlat_resolve(head, &(xlat_res_rules_t){ .allow_unresolved = false }) < 0) return -1;
+ }
+
if (head->instantiated) return 0;
ret = xlat_eval_walk(head, _xlat_instantiate_ephemeral_walker, XLAT_INVALID, el);
# @todo - this is an error somehow?
#
xlat_purify (Service-Type == 000-111)
-match ERROR offset 1: No IPv6 component separator: Failed resolving attribute in expansion: Service-Type
+match ERROR offset 0: No IPv6 component separator: Failed resolving attribute in expansion: Service-Type
#match (&Service-Type == (0 - 111))
xlat_purify (ok FOO handled)
# @todo - can't parse years?
#
xlat_purify &Event-Timestamp == 'January 1, 2012'
-match ERROR offset 1: Invalid year string
+match ERROR offset 0: Invalid year string
#match (&Event-Timestamp == 'Jan 1 2012 00:00:00 EST')
# literals are parsed when the conditions are parsed
# string the RHS is.
#
xlat_purify &NAS-Port == X
-match ERROR offset 1: Failed parsing string as type 'uint32'
+match ERROR offset 0: Failed parsing string as type 'uint32'
#match ERROR offset 13: Failed parsing string as type 'uint32'
#
# The attribute/xlat_purify parser does not fall back to bare words
#
xlat_purify request.Foo == 'request.Foo'
-match ERROR offset 1: Invalid attribute reference, missing '&' prefix: Failed resolving attribute in expansion: request.Foo
+match ERROR offset 0: Invalid attribute reference, missing '&' prefix: Failed resolving attribute in expansion: request.Foo
xlat_purify ¬-a-list.User-Name == ¬-a-list.User-Name
match ERROR offset 1: Attribute 'not' not found. Searched in: RADIUS, internal: Unresolved attributes are not allowed here
-# . is a valid dictionarxy name attribute, so we can't error out in pass1
+# . is a valid dictionary name attribute, so we can't error out in pass1
xlat_purify ¬-a-packet.User-Name == ¬-a-packet.User-Name
match ERROR offset 1: Attribute 'not' not found. Searched in: RADIUS, internal: Unresolved attributes are not allowed here