Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8285734

Unexpected Quotes in ProcessBuilder launched App

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3
    • None
    • 8u291
    • core-libs
    • None

    Description

      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 by JDK-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.

      Attachments

        Issue Links

          Activity

            People

              michaelm Michael McMahon
              rriggs Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: