You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Lars Francke (Jira)" <ji...@apache.org> on 2020/01/21 13:12:00 UTC

[jira] [Assigned] (RANGER-2708) Ranger public group check uses wrong comparison for equality

     [ https://issues.apache.org/jira/browse/RANGER-2708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Francke reassigned RANGER-2708:
------------------------------------

    Assignee: Lars Francke

> Ranger public group check uses wrong comparison for equality
> ------------------------------------------------------------
>
>                 Key: RANGER-2708
>                 URL: https://issues.apache.org/jira/browse/RANGER-2708
>             Project: Ranger
>          Issue Type: Bug
>          Components: Ranger
>            Reporter: Lars Francke
>            Assignee: Lars Francke
>            Priority: Major
>         Attachments: RANGER-2708.1.patch
>
>
> In {{RangerBizUtil#checkUsrPermForPolicy}} we can find this piece of code:
> {code:java}
> matchFound = (publicGroupId != null && publicGroupId == permMap.getGroupId()) || isGroupInList(permMap.getGroupId(), userGroups);
> {code}
> {{publicGroupId}} and {{permMap.getGroupId()}} are both Long so testing equality using "{{==}}" is wrong and only works "by accident" or not at all depending on the JVM.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)