Dollar ($) sign gets doubled in credentials if exposed as ENV and used in DSL script

This issue is archived. You can view it, but you can't modify it. Learn more

      Steps to reproduce

      • Create a Username/Password pair in Credentials both should contain dollar signs (for example u$er and pa$$word)
      • Create a seed job in Jenkins
      • Bind this credentials pair as env variables in the job
      • Add "Process Job DSLs" step with the following in script:

       

      println binding.variables.get('STASH_USERNAME')
      println binding.variables.get('STASH_PASSWORD')
      

       

      • Run the job and see both STASH_PASSWORD and STASH_USERNAME unmasked with two dollars:

       

      Processing provided DSL script
      u$$er
      pa$$$$word

      Workaround

      If EnvInjectBuildWrapper is enabled for the job, the result will be

      Processing provided DSL script
      ****
      pa$word

       As you can see, the second dollar in a pa$$word was escaped, which is also wrong.

       

       

            Assignee:
            Jamie Tanna
            Reporter:
            Roman Komkov
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: