Fix for bug in opendj-ldap-toolkit-2.6.0 on Windows

There’s a bug in one of the Windows batch files for ForgeRock’s OpenDJ LDAP Toolkit 2.6.0 that causes all of the utilities in the package to fail with the error: “The system cannot find the batch label specified – check”. This was fixed in OpenDJ 2.6.1, but that’s only available under subscription, so here’s the fix for the rest of us.

There are newer versions of the the OpenDJ LDAP Toolkit. The latest nightly for 3.0.0 works just fine as far as I can tell, but I’m not fond of running nightlies in production, so I’ve continued using 2.6.0 on my Linux servers and workstations, where it has replaced the OpenLDAP tools that are otherwise standard with most distributions.

Just recently I was trimming the software on my work laptop which runs Windows 7 Professional. On that particular machine I’d been running for 2.6.0 version of the full OpenDJ server for a few years. I decided to delete the server install and replace it with the toolkit (the batch file that shipped with the OpenDJ server 2.6.0 utilities did not have the bug in question).

Installation of the toolkit on Windows was as simple as unzipping the downloaded distribution file to my preferred location, C:\apps\opendj. I then added C:\apps\opendj\bat to the system PATH, as this is where the batch files that launch the Java based OpenDJ utilities reside.

After getting the error noted above I searched around the Internet a bit and found OPENDJ-877, which complained about this condition existing in the 2.6.0 version of the tookit and SDK.

The fix was simple, changing a single line (185) that erroneously called a “check” condition that wasn’t defined anywhere else in the _script_util.bat script under $INSTALLDIR\lib (in my case C:\apps\opendj\lib) to instead use “end”.

This is what the line in question looked like before the change:

if [%1] == [] goto check
if [%1] == [--help] goto end
if [%1] == [-H] goto end
if [%1] == [--version] goto end
if [%1] == [-V] goto end
if [%1] == [--fullversion] goto end
if [%1] == [-F] goto end
goto isVersionOrHelp

Here it is with the fix in place:

if [%1] == [] goto end
if [%1] == [--help] goto end
if [%1] == [-H] goto end
This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).