Except for Colubris, who use it
return -1;
}
+ /*
+ * Disallow attributes of type zero.
+ */
+ if (!attr && !vendor) {
+ fr_strerror_printf("dict_addattr: Attribute 0 is invalid and cannot be used");
+ return -1;
+ }
/*
* If the attr is '-1', that means use a pre-existing
return -1;
}
+ if (!attr && dv->type != 1) {
+ fr_strerror_printf("dict_addattr: Attribute %s cannot have value zero",
+ name);
+ return -1;
+ }
+
/*
* FIXME: Switch over dv->type, and limit things
* properly.
break;
case 1:
- if (data[0] == 0) goto zero;
+ /*
+ * Zero is allowed, because the Colubris
+ * people are dumb and use it.
+ */
break;
default: