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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • master
    • 0.7.2, 2.0.0, 1.1.1, 1.2.1
    • Ranger
    • 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

            abhayk Abhay Kulkarni
            abhayk Abhay Kulkarni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: