From c49b083aacb640688172046bc729f828e45ffa1b Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 30 Oct 2006 23:23:25 +0000
Subject: [PATCH] Update the LDAPCompare tool so that it will exit with an error if no entry DNs were provided (either from a DN file or as trailing command-line arguments that appear after the attribute-value assertion).

---
 opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

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 4f6b766..0424c39 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
@@ -512,6 +512,14 @@
       dnStrings.add(s);
     }
 
+    // If no DNs were provided, then exit with an error.
+    if (dnStrings.isEmpty())
+    {
+      int msgID = MSGID_LDAPCOMPARE_NO_DNS;
+      err.println(getMessage(msgID));
+      return 1;
+    }
+
     // parse the attribute string
     int idx = attributeString.indexOf(":");
     if(idx == -1)

--
Gitblit v1.10.0