Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-8857

Fix subprocess(flags) logic on Windows to handle arguments with quotes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None

    Description

      In the SubprocessTest.Flags unit test, a bug was discovered where the flags argument flags.s3 = "\"geek\""; does not make it round-trip back to the test. It is because the stringify_args logic in shell.hpp purposefully (correctly?) surrounds an argument that contains a double quote with a pair of double quotes. Thus the final command-line flag looks like "\"--s3=\\\"geek\\\"\"", which flags.load() then fails to reparse. The same problem occurs for the (more complicated) JSON flag.

      I believe this is because the original logic was expecting the shell to drop the quotes (echo "-s3=\"geek\"" in Bash returns s3="geek", but cmd.exe echos "-s3=\"geek\"", exactly what was passed. Maybe the test just needs to be fixed; maybe the stringifier shouldn't add more quotes; maybe flags.load() needs to parse the quotes and escapes.

      For now, we're enabling the rest of the test by turning off those two checks.

      Attachments

        Activity

          People

            radhikaj Radhika Jandhyala
            andschwa Andrew Schwartzmeyer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: