]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix error messages
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Dec 2019 13:51:11 +0000 (08:51 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 6 Dec 2019 14:17:56 +0000 (09:17 -0500)
src/lib/util/dict_tokenize.c
src/lib/util/dict_validate.c

index c34548b232557c48773a6beb1c17629b57445f1b..3f98ae6615bc22a597e613caec9c4e824a963ceb 100644 (file)
@@ -390,11 +390,6 @@ static int dict_process_flag_field(dict_tokenize_ctx_t *ctx, char *name, fr_type
                                fr_strerror_printf("The 'length' flag can only be used with value 'uint16'");
                        }
 
-                       if ((type != FR_TYPE_STRING) && (type != FR_TYPE_OCTETS) && (type != FR_TYPE_STRUCT)) {
-                               fr_strerror_printf("The 'length' flag can only be used for attributes of type 'string' or 'octets'");
-                               return -1;
-                       }
-
                        flags->extra = 1;
                        flags->subtype = FLAG_LENGTH_UINT16;
 
index 36ea48d0967749a047692af0287042e3f3b317b0..4268c9ddea7c925be6f699892e1f178945cb1066 100644 (file)
@@ -267,9 +267,10 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
 
                if ((flags->subtype == FLAG_LENGTH_UINT16) &&
                    ((type != FR_TYPE_STRING) && (type != FR_TYPE_OCTETS) && (type != FR_TYPE_STRUCT))) {
-                               fr_strerror_printf("The 'length' flag can only be used for attributes of type 'string' or 'octets'");
-                               return -1;
-                       }
+                       fr_strerror_printf("The 'length' flag cannot be used used with type %s",
+                                          fr_table_str_by_value(fr_value_box_type_table, type, "<UNKNOWN>"));
+                       return -1;
+               }
 
                FORBID_OTHER_FLAGS(extra);
        }