]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow ::NAME for enum names
authorAlan T. DeKok <aland@freeradius.org>
Fri, 29 Sep 2023 17:09:05 +0000 (13:09 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 29 Sep 2023 22:43:32 +0000 (18:43 -0400)
src/lib/util/value.c

index ff9d0449592230caae9dd9e4504612e2b5ddab78..b2836df3da68a6a2c03ce1f5166b8db69c26f25c 100644 (file)
@@ -4633,10 +4633,12 @@ ssize_t fr_value_box_from_substr(TALLOC_CTX *ctx, fr_value_box_t *dst,
        /*
         *      Lookup any names before continuing
         */
-       if (dst_enumv) {
+       if (dst_enumv && dst_enumv->flags.has_value) {
                size_t                  name_len;
                fr_dict_enum_value_t    *enumv;
 
+               (void) fr_sbuff_adv_past_str_literal(&our_in, "::");
+
                /*
                 *      Create a thread-local extensible buffer to
                 *      store unescaped data.
@@ -4678,7 +4680,7 @@ parse:
                /*
                 *      We've not unescaped the string yet, produce an unescaped version
                 */
-               if (!dst_enumv) {
+               if (!dst_enumv || !unescaped) {
                        char *buff;
 
                        if (unlikely(fr_sbuff_out_aunescape_until(ctx, &buff, &our_in, SIZE_MAX,
@@ -4708,7 +4710,7 @@ parse:
                 *      is literal data, not hex encoded data.
                 */
                if (rules->escapes || !fr_sbuff_adv_past_strcase_literal(&our_in, "0x")) {
-                       if (!dst_enumv) {
+                       if (!dst_enumv || !unescaped) {
                                char    *buff = NULL;
                                uint8_t *bin;