Reported by github user jrobichaux.
Regarding https://bugs.openjdk.java.net/browse/JDK-8282008 and your fix at https://github.com/openjdk/jdk/pull/7709 , I have a couple of questions:
1) Will this fix be included with the Java 8 builds as well?
2) We just ran into this bug, and I wanted to make sure the case we ran into is also covered by your fix. We have something like this:
List<String> args = Arrays.asList("java", "-cp", "c:/java", "-Dprocess.dir=\"c:/logs\"", "prod.ProcessFiles");
ProcessBuilder pb = new ProcessBuilder(args);
Process p = pb.start();
int exitCode = p.waitFor();
In our case, the process.dir system variable used to be passed as c:/logs, but with OpenJDK 8U292 it started getting passed as "c:/logs" with quotes around the value.
I think what happened is the argument used to be passed directly as:
-Dprocess.dir="c:/logs"
But with the bug it started getting passed as:
-Dprocess.dir="c:/logs
Without the trailing quote. Or something like that, I'm not 100% sure.
Would you please check to see if my use-case is also fixed byJDK-8282008? Based on the ArgCheck test you wrote, I wasn't sure if it was covered. Prior to OpenJDK 8U292 this code had worked properly for a long, long time.
Regarding https://bugs.openjdk.java.net/browse/JDK-8282008 and your fix at https://github.com/openjdk/jdk/pull/7709 , I have a couple of questions:
1) Will this fix be included with the Java 8 builds as well?
2) We just ran into this bug, and I wanted to make sure the case we ran into is also covered by your fix. We have something like this:
List<String> args = Arrays.asList("java", "-cp", "c:/java", "-Dprocess.dir=\"c:/logs\"", "prod.ProcessFiles");
ProcessBuilder pb = new ProcessBuilder(args);
Process p = pb.start();
int exitCode = p.waitFor();
In our case, the process.dir system variable used to be passed as c:/logs, but with OpenJDK 8U292 it started getting passed as "c:/logs" with quotes around the value.
I think what happened is the argument used to be passed directly as:
-Dprocess.dir="c:/logs"
But with the bug it started getting passed as:
-Dprocess.dir="c:/logs
Without the trailing quote. Or something like that, I'm not 100% sure.
Would you please check to see if my use-case is also fixed by
- relates to
-
JDK-8282008 Incorrect handling of quoted arguments in ProcessBuilder
- Closed