You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sr...@apache.org on 2014/03/29 04:17:34 UTC
git commit: [SENTRY-120] Unit tests fail on Macs due to path
comparision
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 <sr...@clouera.com>
Authored: Fri Mar 28 18:53:50 2014 -0700
Committer: Sravya Tirukkovalur <sr...@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()))) {