From e7c0b27a0618693e1eba321fe81377cc0faac59f Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 08 Oct 2006 22:49:12 +0000
Subject: [PATCH] Update the LDAPCompare tool so that it will fail with an error if an assertion value is supposed to be base64-encoded but an error occurs while trying to decode it.
---
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java | 5 ++++-
opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java | 13 +++++++++++++
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java b/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
index 39ade73..97fe9d2 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
@@ -6612,6 +6612,16 @@
/**
+ * The message ID for the message that will be used if an assertion value that
+ * is supposed to be base64-encoded can't be decoded. This does not take any
+ * arguments.
+ */
+ public static final int MSGID_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 673;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -7190,6 +7200,9 @@
"Use the LDAP assertion control so that the compare is " +
"only processed if the target entry matches the provided " +
"assertion filter.");
+ registerMessage(MSGID_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE,
+ "The assertion value was indicated to be base64-encoded, " +
+ "but an error occurred while trying to decode the value.");
registerMessage(MSGID_SEARCH_DESCRIPTION_BASEDN,
"The base DN for the search.");
registerMessage(MSGID_SEARCH_DESCRIPTION_SIZE_LIMIT,
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
index db885ff..b123757 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -538,7 +538,10 @@
catch (ParseException e)
{
assert debugException(CLASS_NAME, "main", e);
- attributeVal = remainder.getBytes();
+
+ int msgID = MSGID_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE;
+ err.println(getMessage(msgID));
+ return 1;
}
} else if(nextChar == '<')
{
--
Gitblit v1.10.0