accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Turner (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (ACCUMULO-3734) Possible bug in VisibilityConstraint
Date Wed, 30 Dec 2015 23:13:49 GMT

    [ https://issues.apache.org/jira/browse/ACCUMULO-3734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075504#comment-15075504
] 

Keith Turner edited comment on ACCUMULO-3734 at 12/30/15 11:13 PM:
-------------------------------------------------------------------

I looked into this and modified a test so that it fails.  The problem is that quoted authorizations
containing {{"}} or \ (tired to format slash char as monospace, but that broke jira) will
not match properly when {{VisibilityEvaluator(AuthorizationContainer)}} is used.

{noformat}
$ git diff
diff --git a/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
b/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
index 2996970..ac9ef1e 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
@@ -88,8 +88,17 @@ public class VisibilityEvaluatorTest {
 
   @Test
   public void testQuotedExpressions() throws VisibilityParseException {
-    VisibilityEvaluator ct = new VisibilityEvaluator(new Authorizations("A#C", "A\"C", "A\\C",
"AC"));
 
+    Authorizations auths = new Authorizations("A#C", "A\"C", "A\\C", "AC");
+    VisibilityEvaluator ct = new VisibilityEvaluator(auths);
+    runQuoteTest(ct);
+
+    // constuct VisibilityEvaluator using another constructor and run test again
+    ct = new VisibilityEvaluator((AuthorizationContainer) auths);
+    runQuoteTest(ct);
+  }
+
+  private void runQuoteTest(VisibilityEvaluator ct) throws VisibilityParseException {
     assertTrue(ct.evaluate(new ColumnVisibility(quote("A#C") + "|" + quote("A?C"))));
     assertTrue(ct.evaluate(new ColumnVisibility(new ColumnVisibility(quote("A#C") + "|" +
quote("A?C")).flatten())));
     assertTrue(ct.evaluate(new ColumnVisibility(quote("A\"C") + "&" + quote("A\\C"))));

{noformat}



was (Author: kturner):
I looked into this and modified a test so that it fails.  The problem is that quoted authorizations
containing {{"}} or {{\}} will not match properly when {{VisibilityEvaluator(AuthorizationContainer)}}
is used.

{noformat}
$ git diff
diff --git a/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
b/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
index 2996970..ac9ef1e 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
@@ -88,8 +88,17 @@ public class VisibilityEvaluatorTest {
 
   @Test
   public void testQuotedExpressions() throws VisibilityParseException {
-    VisibilityEvaluator ct = new VisibilityEvaluator(new Authorizations("A#C", "A\"C", "A\\C",
"AC"));
 
+    Authorizations auths = new Authorizations("A#C", "A\"C", "A\\C", "AC");
+    VisibilityEvaluator ct = new VisibilityEvaluator(auths);
+    runQuoteTest(ct);
+
+    // constuct VisibilityEvaluator using another constructor and run test again
+    ct = new VisibilityEvaluator((AuthorizationContainer) auths);
+    runQuoteTest(ct);
+  }
+
+  private void runQuoteTest(VisibilityEvaluator ct) throws VisibilityParseException {
     assertTrue(ct.evaluate(new ColumnVisibility(quote("A#C") + "|" + quote("A?C"))));
     assertTrue(ct.evaluate(new ColumnVisibility(new ColumnVisibility(quote("A#C") + "|" +
quote("A?C")).flatten())));
     assertTrue(ct.evaluate(new ColumnVisibility(quote("A\"C") + "&" + quote("A\\C"))));

{noformat}

> Possible bug in VisibilityConstraint
> ------------------------------------
>
>                 Key: ACCUMULO-3734
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3734
>             Project: Accumulo
>          Issue Type: Bug
>            Reporter: Keith Turner
>             Fix For: 1.7.2, 1.8.0
>
>
> ACCUMULO-1681 modified which constructor from {{VisibilityEvaluator}} that  {{VisibilityConstraint}}
uses.  After the modification {{escape()}} is no longer called (the old constructor called
escape, and the new one does not).  Not sure if this is a problem.
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message