提交 575aae29 编写于 作者: I igerasim

8062170: java.security.ProviderException: Error parsing configuration with space

Summary: Updated to parse library path as a line which can contain quoted strings.
Reviewed-by: vinnie
上级 a7b46311
...@@ -584,16 +584,24 @@ final class Config { ...@@ -584,16 +584,24 @@ final class Config {
} }
private String parseLine() throws IOException { private String parseLine() throws IOException {
String s = parseWord(); // allow quoted string as part of line
String s = null;
while (true) { while (true) {
int token = nextToken(); int token = nextToken();
if ((token == TT_EOL) || (token == TT_EOF)) { if ((token == TT_EOL) || (token == TT_EOF)) {
break; break;
} }
if (token != TT_WORD) { if (token != TT_WORD && token != '\"') {
throw excToken("Unexpected value"); throw excToken("Unexpected value");
} }
s = s + " " + st.sval; if (s == null) {
s = st.sval;
} else {
s = s + " " + st.sval;
}
}
if (s == null) {
throw excToken("Unexpected empty line");
} }
return s; return s;
} }
...@@ -653,7 +661,9 @@ final class Config { ...@@ -653,7 +661,9 @@ final class Config {
// //
private String parseLibrary(String keyword) throws IOException { private String parseLibrary(String keyword) throws IOException {
String lib = parseStringEntry(keyword); checkDup(keyword);
parseEquals();
String lib = parseLine();
lib = expand(lib); lib = expand(lib);
int i = lib.indexOf("/$ISA/"); int i = lib.indexOf("/$ISA/");
if (i != -1) { if (i != -1) {
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
*/ */
/** /**
* @test * @test
* @bug 6581254 6986789 7196009 * @bug 6581254 6986789 7196009 8062170
* @summary Allow '~', '+' and quoted paths in config file * @summary Allow '~', '+', and quoted paths in config file
* @author Valerie Peng * @author Valerie Peng
*/ */
...@@ -34,7 +34,7 @@ import java.lang.reflect.*; ...@@ -34,7 +34,7 @@ import java.lang.reflect.*;
public class ConfigShortPath { public class ConfigShortPath {
private static final String[] configNames = { private static final String[] configNames = {
"csp.cfg", "cspPlus.cfg", "cspQuotedPath.cfg" "csp.cfg", "cspPlus.cfg", "cspSpace.cfg", "cspQuotedPath.cfg"
}; };
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
......
showInfo = false
name = test
library = C:\pki DLL\x64\acpkcs211.dll
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册