com.sun.security.auth.login.ConfigFile issue when java.security.auth.login.config path contains spaces and accents
Baptiste Mesta
baptiste.mesta at bonitasoft.com
Fri Mar 4 01:48:35 PST 2011
Hi,
I would like to report a bug on com.sun.security.auth.login.ConfigFile, but
since i haven't found the bug tracker i report it here. Please let me know
if it's not the good place to do that.
Here is the issue.
When the path of the file contained in the system
property java.security.auth.login.config contains accents exceptions are
thrown on Open JDK 6
But on a Sun JDK there is no issue.
Here is the code that cause the error:
On Open JDK: (line 200)
try {
configURL = new URL(extra_config);
} catch (java.net.MalformedURLException mue) {
File configFile = new File(extra_config);
if (configFile.exists()) {
configURL = configFile.toURI().toURL();
} else {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
("extra_config (No such file or directory)",
"sun.security.util.AuthResources"));
Object[] source = {extra_config};
throw new IOException(form.format(source));
}
}
But on The Sun JDK (1.5.0 update 19) it's like that (line 143)
try {
configURL = new URL(extra_config);
} catch (java.net.MalformedURLException mue) {
File configFile = new File(extra_config);
if (configFile.exists()) {
configURL = new URL("file:" +
configFile.getCanonicalPath());
} else {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
("extra_config (No such file or directory)",
"sun.security.util.AuthResources"));
Object[] source = {extra_config};
throw new IOException(form.format(source));
}
}
You can notice here on Open JDK
configURL = configFile.toURI().toURL();
the make the config url change space by %20 while on Sun JDK
configURL = new URL("file:" +
configFile.getCanonicalPath());
Don't change space by %20
Having the %20 make the code that follow throws exceptions.
I'm using
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
Thank you for reading this :)
Best Regards,
--
*Baptiste Mesta
R&D Engineer*
<http://www.bonitasoft.com/products/BPM_download.php>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20110304/4f59321e/attachment.html
More information about the net-dev
mailing list