From f767be424e83355aeb5d7213995d2cac880495b6 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Wed, 22 Jun 2011 15:07:38 +0000
Subject: [PATCH] Fix issue OPENDJ-211. The value part of control specification is optional. And therefore there should be no : to finish the specification. Now if the specification ends with :, then it's the same as no value. Test added with the ManageDSAIt control.

---
 opends/src/server/org/opends/server/tools/LDAPToolUtils.java |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/LDAPToolUtils.java b/opends/src/server/org/opends/server/tools/LDAPToolUtils.java
index 5310fe2..3c2e805 100644
--- a/opends/src/server/org/opends/server/tools/LDAPToolUtils.java
+++ b/opends/src/server/org/opends/server/tools/LDAPToolUtils.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
+ *      Portions Copyright 2011 ForgeRock AS
  */
 package org.opends.server.tools;
 import org.opends.messages.Message;
@@ -165,6 +166,11 @@
     }
 
     String valString = remainder.substring(idx+1, remainder.length());
+    if (valString.length() == 0)
+    {
+      control = new LDAPControl(controlOID, controlCriticality);
+      return control;
+    }
     if(valString.charAt(0) == ':')
     {
       controlValue =

--
Gitblit v1.10.0