Bug 1029079 - Installer must escape backslashes in paths during post-install configuration
Installer must escape backslashes in paths during post-install configuration
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Installer (Show other bugs)
Unspecified Windows
unspecified Severity urgent
: CR3
: EAP 6.2.0
Assigned To: Francisco Canas
Petr Kremensky
Russell Dickenson
Depends On:
  Show dependency treegraph
Reported: 2013-11-11 10:49 EST by Petr Kremensky
Modified: 2013-12-15 11:15 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-12-15 11:15:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Kremensky 2013-11-11 10:49:49 EST
Description of problem:
 Installer must escape '\' used as path delimiter on windows for all post-install actions, because '\' is omitted. 

Version-Release number of selected component (if applicable):
 EAP 6.2.0.ER7

How reproducible:

Steps to Reproduce:
 1. Run gui installer. Use default options to get onto Post-intall configuration screen. 
 2. Choose to "Enable SSL security".
 3. On SSL screen enter some password and location of keystore (eg. W:\pkremens\installer\ssl.keystore)
 4. Finish the installation and observe server configuration files (eg.standalone.xml)

Actual results:
 command in batch: 
 content of standalone.xml file:
   <keystore keystore-password="password" path="W:pkremensinstallerssl.keystore"/>
Server failt to start.

Expected results:
 command in batch:
 content of standalone.xml file:
   <keystore keystore-password="password" path="W:pkremens\\installer\\ssl.keystore"/>

Additional info:
 - see BZ1024381 - windows paths with '\' as delimiter are not used correctly. '\' is omited
 - we should fix this in all post-install actions entering some path (Install password vault, Enable SSL security, and Add a security-domain)
Comment 1 Francisco Canas 2013-11-18 09:32:50 EST
I've added the necessary extra escape characters to the Installer's CLI commands so that windows paths are inserted into the batch command and the config xmls with the proper escaped backslashes like so: 


Note: The above works, but then final Installationlog file will show the command with extra escape characters, which unfortunately means that it is no longer reproducible by the user int he CLI (unless he removes the extra \'s). This is due to the way the CLI returns info (through the stdout rather then as a return value) and how we capture that info in order to log it. Will try to find a way to display the correct path in the log, but it may require some more modifications to izpack that I didn't want to make so close to the release.

Comment 2 Petr Kremensky 2013-11-19 10:11:28 EST
I see things like:
in xml files and CLI log. Although it is working, we should definitely spend some time trying to find cleaner solution for 6.3 (agree with avoiding more complicated modifications to izpack now).

Please fix also commands using Keystore and Truststore URL during JSSE configuration, the rest seems to be fine.
Comment 3 Thomas Hauser 2013-11-19 11:38:51 EST
Please note that all of this is a side effect of the JBoss CLI API, unfortunately.
Comment 4 Francisco Canas 2013-11-19 12:25:43 EST
I have added similar path escaping to the JSSE keystore and truststore URL elements. 

Note that the JSSE properties are parsed differently by the CLI, so the actual number of escape characters required in the installer is halved. This has the unfortunate side effect of creating more inconsistency in the Installationlog file:

For SSL that path appears like this:

For JSSE the path appears like this:

Even though the path appears like this in the actual xmls for *both*:

For 6.3 we'll come up with some other workaround to replace the paths shown in the logs with the third version so it's consistent with the xml files.
Comment 5 Francisco Canas 2013-11-19 14:04:16 EST
One more note:

Made a few changes in order to preserve spaces in the paths:
(ie. c:\my folder\keystore.jks)

This again changes what we see in the Installationlogs, but it is now more consistent. All paths will have the same number of escape chars.
Comment 6 Petr Kremensky 2013-11-20 01:19:37 EST
I am aware that CLI is villain here, we were complaining about this (BZ1024381), but we didn't succeeded so far :/.
Comment 7 Petr Kremensky 2013-11-20 08:44:34 EST
There is one more thing that need to be fixed. You've accidentally removed double quotes from vault configuration command on KEYSTORE_URL and KEYSTORE_FILE_DIR attribute values.

Command looks like:
...("KEYSTORE_URL" => /home/pkremens/jbossqe-eap-tests-installer/src/test/resources/vault/vault.keystore), ... ("ENC_FILE_DIR" => /home/pkremens/jbossqe-eap-tests-installer/target/eap/)])

This is throwing Vault Reader Exception -> installation fails

Comment 8 Francisco Canas 2013-11-20 09:49:27 EST
I actually re-added the quotes yesterday (see comment 5) because the CLI wasn't preserving spaces in the path otherwise. The vault installation succeeds with the command:

/core-service=vault:add(vault-options=[("KEYSTORE_URL" => "/home/yyz/fcanas/vault/keystore.jks"), ("KEYSTORE_PASSWORD" => "MASK-1KXfR4wmalv87Emab3wgdL"), ("KEYSTORE_ALIAS" => "myvault"), ("SALT" => "12345678"), ("ITERATION_COUNT" => "44"), ("ENC_FILE_DIR" => "/home/yyz/fcanas/EAP-6.2.0/")])
The batch executed successfully
{"outcome" => "success"}

This update will be in the re-spin and/or CR3.
Comment 9 Petr Kremensky 2013-11-26 02:37:39 EST
Verified on EAP 6.2.0.CR3 installer.

Note You need to log in before you can comment on or make changes to this bug.