accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1477732 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
Date Tue, 30 Apr 2013 17:27:02 GMT
Author: ecn
Date: Tue Apr 30 17:26:57 2013
New Revision: 1477732

URL: http://svn.apache.org/r1477732
Log:
ACCUMULO-1361 committing Corey Nolet's for zero-length ColumnVisibility

Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
    accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java?rev=1477732&r1=1477731&r2=1477732&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
Tue Apr 30 17:26:57 2013
@@ -79,6 +79,8 @@ public class VisibilityEvaluator {
   }
   
   private final boolean evaluate(final byte[] expression, final Node root) throws VisibilityParseException
{
+    if(expression.length == 0)
+      return true;
     switch (root.type) {
       case TERM:
         return auths.contains(root.getTerm(expression));

Modified: accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java?rev=1477732&r1=1477731&r2=1477732&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
(original)
+++ accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/security/VisibilityEvaluatorTest.java
Tue Apr 30 17:26:57 2013
@@ -35,6 +35,9 @@ public class VisibilityEvaluatorTest {
   public void testVisibilityEvaluator() throws VisibilityParseException {
     VisibilityEvaluator ct = new VisibilityEvaluator(ByteArraySet.fromStrings("one", "two",
"three", "four"));
     
+    // test for empty vis
+    assertTrue(ct.evaluate(new ColumnVisibility(new byte[0])));
+    
     // test for and
     assertTrue("'and' test", ct.evaluate(new ColumnVisibility("one&two")));
     



Mime
View raw message