]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better error messages, so that we know what's going on
authorAlan T. DeKok <aland@freeradius.org>
Wed, 11 Oct 2023 19:53:44 +0000 (15:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 11 Oct 2023 19:53:44 +0000 (15:53 -0400)
src/lib/util/pair_legacy.c

index dbff76ae2902619a5e99e4281e2cbe210287309b..1410946fb5a015fcd6ea18587edb5246bed27c9c 100644 (file)
@@ -220,11 +220,15 @@ static ssize_t fr_pair_list_afrom_substr(TALLOC_CTX *ctx, fr_dict_attr_t const *
                        if (err == FR_DICT_ATTR_NOTFOUND) {
                                uint8_t const *q;
 
-                       notfound:
-                               for (q = (uint8_t const *) p; q < (uint8_t const *) end && fr_dict_attr_allowed_chars[*q]; q++) {
-                                       /* nothing */
+                               if (!fr_dict_attr_allowed_chars[(unsigned char) *p]) {
+                                       fr_strerror_printf("Invalid character '%c' in attribute name at %s", *p, p);
+                               } else {
+                               notfound:
+                                       for (q = (uint8_t const *) p; q < (uint8_t const *) end && fr_dict_attr_allowed_chars[*q]; q++) {
+                                               /* nothing */
+                                       }
+                                       fr_strerror_printf("Unknown attribute \"%.*s\" for parent \"%s\"", (int) (q - ((uint8_t const *) p)), p, my_parent->name);
                                }
-                               fr_strerror_printf("Unknown attribute \"%.*s\" for parent \"%s\"", (int) (q - ((uint8_t const *) p)), p, my_parent->name);
                        }
                error:
                        fr_dict_unknown_free(&da_unknown);