if (!paircmp_find(tmpl_da(map->lhs))) return true;
- if (tmpl_is_regex_xlat_unresolved(map->rhs)) {
+ /*
+ * It's a pair comparison. Do additional checks.
+ */
+ if (tmpl_contains_regex(map->rhs)) {
cf_log_err(map->ci, "Cannot compare virtual attribute %s via a regex", map->lhs->name);
return false;
}
return false;
}
+ /*
+ * Force the RHS to be cast to whatever the LHS da is.
+ */
+ (void) tmpl_cast_set(map->rhs, tmpl_da(map->lhs)->type);
+
if (map->op != T_OP_CMP_EQ) {
cf_log_err(map->ci, "Must use '==' for comparisons with virtual attribute %s", map->lhs->name);
return false;