Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/22435 )

Change subject: IMPALA-13722: Ranger request should have no null values in the 
resources map
......................................................................

IMPALA-13722: Ranger request should have no null values in the resources map

Each Ranger privilege grant/revoke request has a resources map to
describe the target resource, e.g. db, table, url, etc. The keys of the
resources map are predefined strings like "database", "table", "column",
"url", etc. The values are the actual resource name or "*" as a wildcard
for all such kinds of resources.

Our FE tests unintentionally set null values on "url" when the resources
map doesn't have such a key. See AuthorizationTestBase#updateUri().
Using null as the value is an undefined behavior and it causes
NullPointerException in newer versions of Ranger when granting/revoking
privileges (might due to RANGER-4638 that adds a code to split the
string value).

This patch fixes AuthorizationTestBase#updateUri() to only update the
URL when it's not null and starts with "/".

Tests:
 - Verified the fix in a downstream build with a newer Ranger version
   that hits the issue.

Change-Id: Ibed929bcd25ffdf54fa5f0fc848a0cc13c1fb0a2
Reviewed-on: http://gerrit.cloudera.org:8080/22435
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M fe/src/test/java/org/apache/impala/authorization/AuthorizationTestBase.java
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/22435
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibed929bcd25ffdf54fa5f0fc848a0cc13c1fb0a2
Gerrit-Change-Number: 22435
Gerrit-PatchSet: 3
Gerrit-Owner: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>

Reply via email to