Summary
On Windows, setup.bat and every other tool script fail when OpenDJ is installed into a directory containing spaces and/or parentheses — including the default MSI locations C:\Program Files\OpenDJ and C:\Program Files (x86)\OpenDJ.
Steps to reproduce
- Install the released MSI (or unpack the zip) into the default location, e.g.
C:\Program Files (x86)\OpenDJ.
- Run
setup.bat (or any tool script).
Actual behaviour
Two independent quoting defects in the scripts:
-
Unquoted java.io.tmpdir — _script-util.bat appends the temp-dir Java argument without quotes:
set OPENDJ_JAVA_ARGS=%OPENDJ_JAVA_ARGS% -Djava.io.tmpdir=%OPENDJ_TMP_DIR%
With spaces in the path the argument splits and the CheckJVMVersion probe fails; setup.bat and every tool abort with "The detected Java version could not be used…". Reproduced in CI by installing the released 5.1.1 MSI into its default directory: https://github.com/vharseko/OpenDJ/actions/runs/28599532189/job/84844211518
-
Classpath building breaks on parentheses — _script-util.bat passes unquoted paths to setcp.bat, and setcp.bat compares arguments with if ""%1""=="""". The argument-joining hack survives spaces, but a parenthesis in the path — (x86) — breaks the cmd parser with "… was unexpected at this time", so setup.bat exits with 255: https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/28613924513/job/84936550267
Expected behaviour
All scripts work from any install directory, including paths with spaces and parentheses.
Affected versions
Both defects date back to the original scripts and affect every delivery (zip and MSI) installed into such a path.
Summary
On Windows,
setup.batand every other tool script fail when OpenDJ is installed into a directory containing spaces and/or parentheses — including the default MSI locationsC:\Program Files\OpenDJandC:\Program Files (x86)\OpenDJ.Steps to reproduce
C:\Program Files (x86)\OpenDJ.setup.bat(or any tool script).Actual behaviour
Two independent quoting defects in the scripts:
Unquoted
java.io.tmpdir—_script-util.batappends the temp-dir Java argument without quotes:With spaces in the path the argument splits and the
CheckJVMVersionprobe fails;setup.batand every tool abort with "The detected Java version could not be used…". Reproduced in CI by installing the released 5.1.1 MSI into its default directory: https://github.com/vharseko/OpenDJ/actions/runs/28599532189/job/84844211518Classpath building breaks on parentheses —
_script-util.batpasses unquoted paths tosetcp.bat, andsetcp.batcompares arguments withif ""%1""=="""". The argument-joining hack survives spaces, but a parenthesis in the path —(x86)— breaks the cmd parser with "… was unexpected at this time", sosetup.batexits with 255: https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/28613924513/job/84936550267Expected behaviour
All scripts work from any install directory, including paths with spaces and parentheses.
Affected versions
Both defects date back to the original scripts and affect every delivery (zip and MSI) installed into such a path.