Bug 62873 - Tomcat Monitor application will update multi-string values in Windows registry with blank lines
Summary: Tomcat Monitor application will update multi-string values in Windows registr...
Status: RESOLVED MOVED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Meta (show other bugs)
Version: 8.5.34
Hardware: PC All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-01 02:46 UTC by Brandon White
Modified: 2019-08-09 02:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brandon White 2018-11-01 02:46:21 UTC
This is a Windows-platform specific issue.

The Tomcat Monitor application does not prevent a user from accidentally inserting blank lines into the Java Options or Java 9 Options text areas. If a blank line is introduced into either text area and the changes are applied (by hitting the Apply or OK button), the changes are committed to the associating multi-string value in the Windows registry.

If a user were to relaunch the Tomcat Monitor application and view the Java or Java 9 Options again, they would see that the content has been clipped. Individual options above the blank line would remain but any below would not be present. If the Windows Registry editor were used to view the associating multi-string values, they would see all of the content including the blank line.

Changing the options again from within the Tomcat Monitor application will succeed but when the options are committed to the registry multi-string value, any options that existed below the blank line will be removed.

Note that the Windows registry editor will display an error dialog if a user attempts to save a multi-string value with an empty line present. The message is: "Data of type REG_MULTI_SZ cannot contain empty strings. Registry Editor will remove all empty strings found."

Steps to Reproduce:

1) Download latest Tomcat 8 distribution for windows
2) Run service.bat install to install the default tomcat8 service.
3) Run tomcat8w.exe to start the tomcat monitor application. 
4) Switch to the Java tab and edit either the Java Options or Java 9 Options. Insert a blank line somewhere in the middle of the text area. Click OK
5) Run tomcat8w.exe again. Look at the Java Options or Java 9 Options where the blank line was inserted. Notice that all options below the blank line are not visible.
6) Open up the registry editor and navigate to the multi-string value associated with the Java (9) Options text area: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\Tomcat8\Parameters\Java
7) Notice that all content is present (including the blank line) in the registry value.
Comment 1 Mark Thomas 2018-11-01 15:50:31 UTC
This issue needs to be created against Apache Commons Daemon which is the component that provides the Windows Service Wrapper for Apache Tomcat.
Comment 2 Brandon White 2018-11-02 20:23:45 UTC
Thank you for the heads-up Mark. I created a bug against the Apache Commons Daemon project here: https://issues.apache.org/jira/browse/DAEMON-394