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

Protect ExecuteWithLog from running with redirection without a subshell

    Details

    • Type: Bug
    • Status: New
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: infrastructure
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: