sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject git commit: [SENTRY-120] Unit tests fail on Macs due to path comparision
Date Sat, 29 Mar 2014 03:17:34 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/branch-1.3.0 29afed518 -> a66e6fcf1


[SENTRY-120] Unit tests fail on Macs due to path comparision


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/a66e6fcf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/a66e6fcf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/a66e6fcf

Branch: refs/heads/branch-1.3.0
Commit: a66e6fcf1b420528d442e64f4ccb8b7f3947d57c
Parents: 29afed5
Author: Sravya Tirukkovalur <sravya@clouera.com>
Authored: Fri Mar 28 18:53:50 2014 -0700
Committer: Sravya Tirukkovalur <sravya@clouera.com>
Committed: Fri Mar 28 18:53:50 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/sentry/core/common/utils/PathUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/a66e6fcf/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
----------------------------------------------------------------------
diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
index 1659450..962179f 100644
--- a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
@@ -43,8 +43,8 @@ public class PathUtils {
     // request path does not contain relative parts /a/../b &&
     // request path starts with privilege path &&
     // authorities (nullable) are equal
-    String requestPath = ensureEndsWithSeparator(requestURI.getPath());
-    String privilegePath = ensureEndsWithSeparator(privilegeURI.getPath());
+    String requestPath = ensureEndsWithSeparator(requestURI.getPath()).replace("//", "/");
+    String privilegePath = ensureEndsWithSeparator(privilegeURI.getPath()).replace("//",
"/");
     if (requestURI.getPath().equals(requestURI.normalize().getPath()) &&
         requestPath.startsWith(privilegePath) &&
         Strings.nullToEmpty(privilegeURI.getAuthority()).equals(Strings.nullToEmpty(requestURI.getAuthority())))
{


Mime
View raw message