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

Protect ExecuteWithLog from running with redirection without a subshell

XMLWordPrintable

      When calling ExecuteWithLog with a redirection (using > or, possibly, <), the entire command needs to be executed in a subshell, that is, inside a pair of parentheses. This is the callers obligation to ensure, but we have proven multiple times that this is hard to keep in mind, and we got several cases of race conditions due to missing this.

      We should change the implementation of ExecuteWithLog. Either it should always execute in a subshell (but this might prove a too high cost on Windows), or it should check if the command line contains redirection, and automatically add the subshell parentheses in that case. The latter is probably the best option.

            Unassigned Unassigned
            ihse Magnus Ihse Bursie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: