109a78
From e56048c98bfab25ae9453a52bbe6bcc02f20f515 Mon Sep 17 00:00:00 2001
109a78
From: Arran Cudbard-Bell <a.cudbardb@freeradius.org>
109a78
Date: Tue, 25 Jul 2017 14:00:02 -0400
109a78
Subject: [PATCH] Allow paircompare to work with attribute references and
109a78
 expansions.  Hopefully Fixes #1947
109a78
109a78
---
109a78
 src/main/modcall.c | 6 ------
109a78
 src/main/parser.c  | 4 +---
109a78
 2 files changed, 1 insertion(+), 9 deletions(-)
109a78
109a78
diff --git a/src/main/modcall.c b/src/main/modcall.c
109a78
index c385db21f4..4723971d20 100644
109a78
--- a/src/main/modcall.c
109a78
+++ b/src/main/modcall.c
109a78
@@ -3479,12 +3479,6 @@ static bool pass2_callback(void *ctx, fr_cond_t *c)
109a78
 
109a78
 	if (!radius_find_compare(map->lhs->tmpl_da)) return true;
109a78
 
109a78
-	if (map->rhs->type == TMPL_TYPE_ATTR) {
109a78
-		cf_log_err(map->ci, "Cannot compare virtual attribute %s to another attribute",
109a78
-			   map->lhs->name);
109a78
-		return false;
109a78
-	}
109a78
-
109a78
 	if (map->rhs->type == TMPL_TYPE_REGEX) {
109a78
 		cf_log_err(map->ci, "Cannot compare virtual attribute %s via a regex",
109a78
 			   map->lhs->name);
109a78
diff --git a/src/main/parser.c b/src/main/parser.c
109a78
index 5fab262fdc..8b57725a1f 100644
109a78
--- a/src/main/parser.c
109a78
+++ b/src/main/parser.c
109a78
@@ -1196,9 +1196,7 @@ static ssize_t condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *st
109a78
 				 *	and do no parsing until after all of the modules
109a78
 				 *	are loaded.  But that has issues, too.
109a78
 				 */
109a78
-				if ((c->data.map->lhs->type == TMPL_TYPE_LITERAL) &&
109a78
-				    (lhs_type == T_BARE_WORD) &&
109a78
-				    (c->data.map->rhs->type == TMPL_TYPE_LITERAL)) {
109a78
+				if ((c->data.map->lhs->type == TMPL_TYPE_LITERAL) && (lhs_type == T_BARE_WORD)) {
109a78
 					int hyphens = 0;
109a78
 					bool may_be_attr = true;
109a78
 					size_t i;