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

Bound variables strip multiple dollar signs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Labels:
      None
    • Environment:
      Credentials Binding v1.2, Credentials v1.18, Jenkins v1.580.1
    • Similar Issues:

      Description

      A username-password combo is bound to CREDENTIALS, where the password contains two or more consecutive dollar signs.

      Those multiple dollar signs are returned as a single dollar sign in the $CREDENTIALS variable.

        Attachments

          Issue Links

            Activity

            Hide
            mephi42 mephi42 added a comment -

            Sorry, I posted before I saw your reply. Thanks for the information.

            Show
            mephi42 mephi42 added a comment - Sorry, I posted before I saw your reply. Thanks for the information.
            Hide
            jglick Jesse Glick added a comment -

            Perhaps. Anyway, not a bug in this plugin.

            Show
            jglick Jesse Glick added a comment - Perhaps. Anyway, not a bug in this plugin.
            Hide
            mephi42 mephi42 added a comment -

            I was able to work around the problem by putting $$$$$ instead of $$ into the GUI. Maybe this information would be helpful to whomever else bumps into this.

            Show
            mephi42 mephi42 added a comment - I was able to work around the problem by putting $$$$$ instead of $$ into the GUI. Maybe this information would be helpful to whomever else bumps into this.
            Hide
            jglick Jesse Glick added a comment -

            Or just use Pipeline, which will behave correctly.

            Show
            jglick Jesse Glick added a comment - Or just use Pipeline, which will behave correctly.
            Hide
            akom Alexander Komarov added a comment -

            I can confirm that the 5-dollar workaround suggested by mephi42 does work in some cases, but as Jesse Glick points out there are many places in Jenkins where variables are expanded.  

            For example, the workaround works for a general shell step (some-command.sh -arg "$PASSWORD") but not for a gradle step, where even single-quoted switches like '-Pswitch=$PASSWORD' will again lose the extra $s.  

            Pipeline is probably the best solution, but in the interim I found myself having to change the password.

            Show
            akom Alexander Komarov added a comment - I can confirm that the 5-dollar workaround suggested by  mephi42 does work in some cases, but as Jesse Glick points out there are many places in Jenkins where variables are expanded.   For example, the workaround works for a general shell step ( some-command.sh -arg "$PASSWORD" ) but not for a gradle step, where even single-quoted switches like '-Pswitch=$PASSWORD' will again lose the extra $s.   Pipeline is probably the best solution, but in the interim I found myself having to change the password.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                temujin9 Nathaniel Eliot
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: