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)