From: Alan T. DeKok Date: Sun, 7 Dec 2025 00:48:17 +0000 (-0500) Subject: attribute names cannot be solely numerical X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cda2db27cd2e403094dd8906ab902d1b41e2ebb1;p=thirdparty%2Ffreeradius-server.git attribute names cannot be solely numerical --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 09f58992ff1..b009e23f52c 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -1123,12 +1123,20 @@ static int dict_read_process_common(dict_tokenize_ctx_t *dctx, fr_dict_attr_t ** fr_dict_attr_flags_t const *base_flags) { fr_dict_attr_t *da, *to_free = NULL; + size_t len; /* - * Dictionaries need to have real names, not shitty ones. + * Dictionaries need to have real names, not v3-style ones "Attr-#". And not ones which are + * solely numerical. */ if (strncmp(name, "Attr-", 5) == 0) { - fr_strerror_const("Invalid name"); + fr_strerror_const("Invalid name - 'Attr-' is an invalid name"); + return -1; + } + + len = strlen(name); + if (fr_sbuff_adv_past_allowed( &FR_SBUFF_IN(name, len), SIZE_MAX, sbuff_char_class_int, NULL) == len) { + fr_strerror_printf("Invalid attribute name '%s' - the name cannot be an integer", name); return -1; }