Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64751

Environment variables with a trailing double quotes are not escaped correctly on Windows

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • docker-workflow-plugin
    • None
    • Jenkins Version: 2.274
      Docker Pipeline Plugin: 1.25
      Linux master
      Windows agent
    • 1.28-r2

      Seeing an no output hang at the first step run by a docker agent when there is an environment variable with a value that ends with a double quote.

      Like when the github PR being built has a double quote at the end of it's title.

      https://github.com/jenkinsci/docker-workflow-plugin/pull/220 did fix the issue for double quotes in other positions.

       

      In my case, where only github PR titles were an issue, the following is a workaround.

      env.CHANGE_TITLE = env.CHANGE_TITLE.replaceAll('"','\'')
      

      That prevented the hang that had occurred when the PR title (env.CHANGE_ENV) was

      Checking if "quotes" are correctly ("escaped") "even with trailing ones"

      Note the hang did not occur when PR title (env.CHANGE_ENV) was:

      Checking if "quotes" are correctly ("escaped")
      

       

          [JENKINS-64751] Environment variables with a trailing double quotes are not escaped correctly on Windows

          Allen Benz created issue -
          Basil Crow made changes -
          Released As New: 1.28-r2
          Assignee New: Paul "TBBle" Hampson [ p_hampson ]
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Basil Crow made changes -
          Link New: This issue is duplicated by JENKINS-65933 [ JENKINS-65933 ]

            p_hampson Paul "TBBle" Hampson
            allenbenz Allen Benz
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: