Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2247

Ranger Plugin for HDFS throws StringIndexOutOfBounds exception when policy resource is "\"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 0.7.2, 2.0.0, 1.1.1, 1.2.1
    • Component/s: Ranger
    • Labels:
      None

      Description

      With a hdfs policy with a single \ as a resource, Ranger plugin throws exception.

      % hdfs dfs -ls /user/
      ls: String index out of range: -1

      org.apache.hadoop.ipc.RemoteException(java.lang.StringIndexOutOfBoundsException): String index out of range: -1
      at java.lang.String.substring(String.java:1967)
      at org.apache.ranger.plugin.resourcematcher.RecursiveMatcher.getStringToCompare(RangerPathResourceMatcher.java:234)
      at org.apache.ranger.plugin.resourcematcher.CaseSensitiveRecursiveMatcher.isMatch(RangerPathResourceMatcher.java:249)
      at org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher.isMatch(RangerDefaultResourceMatcher.java:45)
      at org.apache.ranger.plugin.policyresourcematcher.RangerDefaultPolicyResourceMatcher.getMatchType(RangerDefaultPolicyResourceMatcher.java:478)
      at org.apache.ranger.plugin.policyevaluator.RangerDefaultPolicyEvaluator.evaluate(RangerDefaultPolicyEvaluator.java:177)

        Attachments

          Activity

            People

            • Assignee:
              abhayk Abhay Kulkarni
              Reporter:
              abhayk Abhay Kulkarni
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: