goto error;
}
- /*
- * We cannot assign a count to an attribute. That must
- * be done in an xlat.
- */
- if ((map->rhs->type == TMPL_TYPE_ATTR) &&
- (map->rhs->tmpl_num == NUM_COUNT)) {
- cf_log_err_cp(cp, "Cannot assign from a count");
- goto error;
+ if (map->rhs->type == TMPL_TYPE_ATTR) {
+ /*
+ * We cannot assign a count to an attribute. That must
+ * be done in an xlat.
+ */
+ if (map->rhs->tmpl_num == NUM_COUNT) {
+ cf_log_err_cp(cp, "Cannot assign from a count");
+ goto error;
+ }
+
+ if (map->rhs->tmpl_da->flags.virtual) {
+ cf_log_err_cp(cp, "Virtual attributes must be in an expansion such as \"%%{%s}\".", map->rhs->tmpl_da->name);
+ goto error;
+ }
}
VERIFY_MAP(map);