From c3383791109653ba0a84ac71d8544354fc913532 Mon Sep 17 00:00:00 2001 From: Cheng JIANG Date: Sat, 18 Apr 2020 13:11:09 +0200 Subject: [PATCH] return None when policy in db isn't p*, g* --- src/adapter.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/adapter.rs b/src/adapter.rs index a058f17..0d38718 100644 --- a/src/adapter.rs +++ b/src/adapter.rs @@ -100,14 +100,16 @@ impl<'a> DieselAdapter { is_filtered = true } } - } - if sec == 'g' { + } else if sec == 'g' { for (i, rule) in f.g.iter().enumerate() { if !rule.is_empty() && rule != &policy[i] { is_filtered = true } } + } else { + return None; } + if !is_filtered { return Some(policy); }