This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new fd55c6f  ATLAS-4536: The newline character in attribues will fail 
simple auth check
fd55c6f is described below

commit fd55c6fe2695c62338c0cfa751d1e019a523e81f
Author: Garry Easop <gea...@cloudera.com>
AuthorDate: Thu Jan 20 11:50:57 2022 -0800

    ATLAS-4536: The newline character in attribues will fail simple auth check
    
    Signed-off-by: Sarath Subramanian <sar...@apache.org>
---
 .../java/org/apache/atlas/authorize/simple/AtlasSimpleAuthorizer.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/authorization/src/main/java/org/apache/atlas/authorize/simple/AtlasSimpleAuthorizer.java
 
b/authorization/src/main/java/org/apache/atlas/authorize/simple/AtlasSimpleAuthorizer.java
old mode 100644
new mode 100755
index 7b99e97..d80cab4
--- 
a/authorization/src/main/java/org/apache/atlas/authorize/simple/AtlasSimpleAuthorizer.java
+++ 
b/authorization/src/main/java/org/apache/atlas/authorize/simple/AtlasSimpleAuthorizer.java
@@ -64,6 +64,7 @@ public final class AtlasSimpleAuthorizer implements 
AtlasAuthorizer {
 
     private AtlasSimpleAuthzPolicy authzPolicy;
 
+    private final static String REGEX_MATCHALL = ".*";
 
     public AtlasSimpleAuthorizer() {
     }
@@ -466,7 +467,7 @@ public final class AtlasSimpleAuthorizer implements 
AtlasAuthorizer {
         if (value == null) {
             ret = true;
         } else {
-            ret = StringUtils.equalsIgnoreCase(value, pattern) || 
value.matches(pattern);
+            ret = pattern.equals(REGEX_MATCHALL) || 
StringUtils.equalsIgnoreCase(value, pattern) || value.matches(pattern);
         }
 
         return ret;

Reply via email to