mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
25.32.2009 27ea664735339eb6127bfb575a587af24cd317fe
Fix for issue 3297 (English answer hardcoded in tools.properties)
Use localized strings to check the answer provided by the user.
Be more permisive and make a non-case sensitive check of the user's answer (so know Yes is accepted).
2 files modified
22 ■■■■ changed files
opendj-sdk/opends/src/messages/messages/tools.properties 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/PromptTrustManager.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/tools.properties
@@ -407,8 +407,8 @@
 I?' response from the Directory Server:  %s
MILD_ERR_LDAPAUTH_WHOAMI_FAILED_204=The 'Who Am I?' request was rejected by \
 the Directory Server
SEVERE_ERR_SEARCH_INVALID_SEARCH_SCOPE_205=Invalid scope %s specified for the \
 search request
SEVERE_ERR_SEARCH_INVALID_SEARCH_SCOPE_205=Invalid scope '%s' specified for \
 the search request
SEVERE_ERR_SEARCH_NO_FILTERS_206=No filters specified for the search request
INFO_VERIFYINDEX_DESCRIPTION_BASE_DN_207=Base DN of a backend \
 supporting indexing. Verification is performed on indexes within the scope of \
@@ -2452,5 +2452,13 @@
the instance directory %s.\nInstance directory is referenced by %s
INFO_LDIFEXPORT_PATH_TO_LDIF_FILE_1662=Exporting to %s
#
# These are the localized version of the answers that the user can provide in
# interactive tools.
#
INFO_PROMPT_YES_COMPLETE_ANSWER_1663=yes
INFO_PROMPT_YES_FIRST_LETTER_ANSWER_1664=y
INFO_PROMPT_NO_COMPLETE_ANSWER_1665=no
INFO_PROMPT_NO_FIRST_LETTER_ANSWER_1666=n
opendj-sdk/opends/src/server/org/opends/server/tools/PromptTrustManager.java
@@ -163,13 +163,19 @@
      {
        System.out.print(prompt);
        String line = reader.readLine().toLowerCase();
        if (line.equals("y") || line.equals("yes"))
        if (line.equalsIgnoreCase(
            INFO_PROMPT_YES_COMPLETE_ANSWER.get().toString()) ||
            line.equalsIgnoreCase(
            INFO_PROMPT_YES_FIRST_LETTER_ANSWER.get().toString()))
        {
          // Returning without an exception is sufficient to consider the
          // certificate trusted.
          return;
        }
        else if (line.equals("n") || line.equals("no"))
        if (line.equalsIgnoreCase(
            INFO_PROMPT_NO_COMPLETE_ANSWER.get().toString()) ||
            line.equalsIgnoreCase(
            INFO_PROMPT_NO_FIRST_LETTER_ANSWER.get().toString()))
        {
          Message message = ERR_PROMPTTM_USER_REJECTED.get();
          throw new CertificateException(message.toString());