From: Arran Cudbard-Bell Date: Thu, 11 Jan 2024 15:10:40 +0000 (-0500) Subject: 'by' is not a name component X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c20a2d6b14517403d03ab87b8223ea5ea3aa8d76;p=thirdparty%2Ffreeradius-server.git 'by' is not a name component --- diff --git a/doc/antora/modules/raddb/pages/mods-available/dict.adoc b/doc/antora/modules/raddb/pages/mods-available/dict.adoc index 915af5569bd..96065423044 100644 --- a/doc/antora/modules/raddb/pages/mods-available/dict.adoc +++ b/doc/antora/modules/raddb/pages/mods-available/dict.adoc @@ -19,18 +19,18 @@ If the attribute does not exist, nothing is returned. .Return: _string_ -### %dict.attr.by.num(__) +### %dict.attr.by_num(__) Takes an attribute number, and returns the canonicalized name of the attribute. If the attribute does not exist, nothing is returned. This function is useful only for "top level" attributes such as `link:https://freeradius.org/rfc/rfc2865.html#User-Name[User-Name]`. -Where the attribute is nested, use `%dict.attr.by.oid()` instead. +Where the attribute is nested, use `%dict.attr.by_oid()` instead. .Return: _string_ -### %dict.attr.by.oid(__) +### %dict.attr.by_oid(__) Takes a full OID reference (e.g. `26.9.1`), and returns the name of the attribute. diff --git a/raddb/mods-available/dict b/raddb/mods-available/dict index bc19695c1d9..5563c447fd8 100644 --- a/raddb/mods-available/dict +++ b/raddb/mods-available/dict @@ -22,18 +22,18 @@ # # .Return: _string_ # -# ### %dict.attr.by.num(__) +# ### %dict.attr.by_num(__) # # Takes an attribute number, and returns the canonicalized name of the attribute. # # If the attribute does not exist, nothing is returned. # # This function is useful only for "top level" attributes such as `User-Name`. -# Where the attribute is nested, use `%dict.attr.by.oid()` instead. +# Where the attribute is nested, use `%dict.attr.by_oid()` instead. # # .Return: _string_ # -# ### %dict.attr.by.oid(__) +# ### %dict.attr.by_oid(__) # # Takes a full OID reference (e.g. `26.9.1`), and returns the name of # the attribute. diff --git a/src/modules/rlm_dict/rlm_dict.c b/src/modules/rlm_dict/rlm_dict.c index 9cff7d61177..b3dc5f7cfbe 100644 --- a/src/modules/rlm_dict/rlm_dict.c +++ b/src/modules/rlm_dict/rlm_dict.c @@ -245,8 +245,8 @@ static int mod_load(void) { xlat_t *xlat; - XLAT_REGISTER("dict.attr.by.num", xlat_dict_attr_by_num, FR_TYPE_STRING, xlat_dict_attr_by_num_args); - XLAT_REGISTER("dict.attr.by.oid", xlat_dict_attr_by_oid, FR_TYPE_STRING, xlat_dict_attr_by_oid_args); + XLAT_REGISTER("dict.attr.by_num", xlat_dict_attr_by_num, FR_TYPE_STRING, xlat_dict_attr_by_num_args); + XLAT_REGISTER("dict.attr.by_oid", xlat_dict_attr_by_oid, FR_TYPE_STRING, xlat_dict_attr_by_oid_args); XLAT_REGISTER("dict.vendor", xlat_vendor, FR_TYPE_STRING, xlat_vendor_args); XLAT_REGISTER("dict.vendor.num", xlat_vendor_num, FR_TYPE_UINT32, xlat_vendor_num_args); XLAT_REGISTER("dict.attr", xlat_attr, FR_TYPE_STRING, xlat_attr_args); @@ -257,8 +257,8 @@ static int mod_load(void) static void mod_unload(void) { - xlat_func_unregister("dict.attr.by.num"); - xlat_func_unregister("dict.attr.by.oid"); + xlat_func_unregister("dict.attr.by_num"); + xlat_func_unregister("dict.attr.by_oid"); xlat_func_unregister("dict.vendor"); xlat_func_unregister("dict.vendor.num"); xlat_func_unregister("dict.attr"); diff --git a/src/tests/keywords/map b/src/tests/keywords/map index 4d12ac5b977..a5e18c3c3fd 100644 --- a/src/tests/keywords/map +++ b/src/tests/keywords/map @@ -2,5 +2,5 @@ # PRE: map-2arg-error map-empty-error map-module-error map-field-error # map csv &User-Name { - &reply.Result-Status := 'field3' + &reply.Result-Status := field3 } diff --git a/src/tests/keywords/ok-return b/src/tests/keywords/ok-return index 9262160dca6..900c3d9f3ae 100644 --- a/src/tests/keywords/ok-return +++ b/src/tests/keywords/ok-return @@ -1,4 +1,4 @@ -&control.Auth-Type := 'Accept' +&control.Auth-Type := Accept &reply.Reply-Message := 'pass' diff --git a/src/tests/modules/dict/map.unlang b/src/tests/modules/dict/map.unlang index fb3ed4a01af..b6a00a979be 100644 --- a/src/tests/modules/dict/map.unlang +++ b/src/tests/modules/dict/map.unlang @@ -2,25 +2,25 @@ &Reply-Message := 'foo' -if (%dict.attr.by.num(1) != 'User-Name') { +if (%dict.attr.by_num(1) != 'User-Name') { test_fail } -if (%dict.attr.by.oid(1) != 'User-Name') { +if (%dict.attr.by_oid(1) != 'User-Name') { test_fail } # Should fail -if (%dict.attr.by.oid(26) != 'Vendor-Specific') { +if (%dict.attr.by_oid(26) != 'Vendor-Specific') { test_fail } # Should fail -if (%dict.attr.by.oid(26.11344) != 'FreeRADIUS') { +if (%dict.attr.by_oid(26.11344) != 'FreeRADIUS') { test_fail } -if (%dict.attr.by.oid(26.11344.1) != 'Proxied-To') { +if (%dict.attr.by_oid(26.11344.1) != 'Proxied-To') { test_fail }