* attribute.
*/
if ((dval = dict_valbyname(vp->da->attr, vp->da->vendor, value)) == NULL) {
- fr_strerror_printf("Unknown value %s for attribute %s",
- value, vp->da->name);
+ fr_strerror_printf("Unknown value '%s' for attribute '%s'", value, vp->da->name);
return false;
}
vp->vp_integer = dval->value;
if (type == T_BARE_WORD) {
if (*value == '&') {
map->src = radius_attr2tmpl(map, value + 1, src_request_def, src_list_def);
-
} else {
if (!isdigit((int) *value) &&
((strchr(value, ':') != NULL) ||
}
break;
+ case VPT_TYPE_LITERAL:
+ /*
+ * If LHS is an attribute, and RHS is a literal, we can
+ * check that the format is correct.
+ */
+ if (map->dst->type == VPT_TYPE_ATTR) {
+ VALUE_PAIR *vp;
+ bool ret;
+
+ MEM(vp = pairalloc(NULL, map->dst->da));
+ vp->op = map->op;
+
+ ret = pairparsevalue(vp, map->src->name);
+ talloc_free(vp);
+ if (!ret) {
+ cf_log_err(ci, "%s", fr_strerror());
+ return NULL;
+ }
+ }
+
default:
break;
}