[Bug 3697] New: Custom JRE/JDK within UTF-8 folder name ( key deployment.jre.dir in in deployment.properties ) are not properly handled

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Fri Feb 15 09:44:15 UTC 2019


            Bug ID: 3697
           Summary: Custom JRE/JDK within UTF-8 folder name ( key
                    deployment.jre.dir in in deployment.properties ) are
                    not properly handled
           Product: IcedTea-Web
           Version: 1.6.2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: NetX (javaws)
          Assignee: jvanek at redhat.com
          Reporter: philippe.doussot at up.coop
                CC: unassigned at icedtea.classpath.org

Created attachment 1723
  --> https://icedtea.classpath.org/bugzilla/attachment.cgi?id=1723&action=edit
itweb-settings validating jdk folder

Bug : Using folder with character outside of ascii table

open : itweb-settings
go to > Menu: JVM Settings
got to > Set a valid path for an alternative JRE

choose a folder name with accent

The folder is tested well and accepted by itweb-settings
cf: jre.png

Console show :
Saving properties into /home/doussot/.config/icedtea-web/deployment.properties

and yes the path is saved but with escaped char sequence (\u00E9) as java
properties spec required :

>file /home/doussot/.config/icedtea-web/deployment.properties
>/home/doussot/.config/icedtea-web/deployment.properties: ASCII text
(no UTF-8)

>grep deployment.jre.dir /home/doussot/.config/icedtea-web/deployment.properties

Then run javaws to try to used specified jdk
This message appeared :
>Your custom JRE /home/doussot/T\u00E9l\u00E9chargements/jdk8u202-b08-jre read from deployment.properties under key deployment.jre.dir as /home/doussot/T\u00E9l\u00E9chargements/jdk8u202-b08-jre is not valid. Using default (/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java, /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfxrt.jar) in attempt to start. Please fix this.

Workaround :
1) Manual editing deployment.jre.dir and write path with UTF-8 "é" correct the
until you open the file with itweb-settings.
Launche it-websetings to check : it is well displayed, but cancel/ok or apply
change encoding again (even cancel rewrite the properties file ! )

2) Use folder path without UTF-8 char ( move your JRE/JDK )

Based on source code analysis from 1.7
I think that plugin/icedteanp/IcedTeaParseProperties.cc
method find_property
dont threat escaped utf-8 char as needed


Characters in keys and elements can be represented in escape sequences similar
to those used for character and string literals (see sections 3.3 and 3.10.6 of
The Javaâ„¢ Language Specification). 

Whe can 
1) Handle special char "\uXXXX" in get_property_value (better solution but
maybe hard)
2) Dont use java.util.Properties and write simple utf-8 key/value file ..
3) Reject path with utf-8 char when validating jre version in ( simplest
solution maybe )

>public static JvmValidationResult validateJvm(String cmd) {

Context :
Bug seen in version:
 icedtea-web 1.6.2 (1.6.2-3.1ubuntu3)

javaws and itweb-settings are from ubuntu package 
cat /etc/lsb-release 



  Installé : 1.6.2-3.1ubuntu3
  Candidat : 1.6.2-3.1ubuntu3
 Table de version :
 *** 1.6.2-3.1ubuntu3 500
        500 http://fr.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20190215/bded6f8e/attachment-0001.html>

More information about the distro-pkg-dev mailing list