Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
2.1.3
-
None
Description
Hello,
in Grouper 2.1.3 if a group name contains a dollar sign followed by a
number, e.g. "i$7fco_gest", the PSP daemon reports a weird error:
java.lang.IndexOutOfBoundsException: No group 7
You will find in annexe an extract of the grouper_error.log showing
that message together with the full java stack.
This does not happen if the dollar sign is followed by a letter.
Since it happens in the context of a replaceAll(regex,replacement), it
looks like the "group 7" in question is in fact referring to what
would have matched the 7th parenthesized expression of a the regular
expression (capturing group).
Strange that a data string (i.e. obtained from the Grouper DB or LDAP)
is used as the replacement string in a replaceAll operation! I guess
that a group name containing a backslash ("\") would also cause
problems in that case.
Eventhough it occurs in the LdapSourceAdapter code, I did not see such
errors in other context than the PSP (in particular the UI and gsh
loader don't seem to trigger it).
Probably a quick fix is to quote sequences of characters, like "$7",
significant in the replacement pattern (may be with quoteReplacement
http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#quoteReplacement%28java.lang.String%29 ).
Best regards,
Dominique
Mr Dominique Petitpierre, user=Dominique.Petitpierre domain=unige.ch
IT Division, University of Geneva, Switzerland