-
Bug
-
Resolution: Fixed
-
Minor
-
CentOS 6.8
Jenkins 2.38
durable-task-plugin 1.12
workflow-aggregator (pipeline) 2.4 and all its dependencies:
workflow-cps (version:2.17)
workflow-support (version:2.5)
workflow-basic-steps (version:2.1)
pipeline-input-step (version:2.1)
pipeline-milestone-step (version:1.0)
pipeline-build-step (version:2.2)
pipeline-stage-view (version:2.0)
workflow-multibranch (version:2.8)
workflow-durable-task-step (version:2.4)
workflow-api (version:2.3)
pipeline-stage-step (version:2.2)
workflow-scm-step (version:2.2)
workflow-cps-global-lib (version:2.3)
workflow-step-api (version:2.3)
workflow-job (version:2.6)CentOS 6.8 Jenkins 2.38 durable-task-plugin 1.12 workflow-aggregator (pipeline) 2.4 and all its dependencies: workflow-cps (version:2.17) workflow-support (version:2.5) workflow-basic-steps (version:2.1) pipeline-input-step (version:2.1) pipeline-milestone-step (version:1.0) pipeline-build-step (version:2.2) pipeline-stage-view (version:2.0) workflow-multibranch (version:2.8) workflow-durable-task-step (version:2.4) workflow-api (version:2.3) pipeline-stage-step (version:2.2) workflow-scm-step (version:2.2) workflow-cps-global-lib (version:2.3) workflow-step-api (version:2.3) workflow-job (version:2.6)
When I run a Jenkinsfile that has a sh step that uses an environment variable (such as a password) that has two $$ in a row, they get replaced with one $.
Here's the steps to reproduce:
1. Make a global credential id "foo", username "foo", password "bar$$baz"
2. Use this Jenkinsfile:
node('linux') { withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'foo', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME']]) { echo "Username: ${env.USERNAME}" echo "Password: ${env.PASSWORD}" sh 'echo Username: $USERNAME, Password: $PASSWORD' } }
When the build runs, the echo steps properly echo the user/pass which are then masked. But the shell step doesn't mask the password, which is incorrect. It has lost a $
[Pipeline] echo Username: **** [Pipeline] echo Password: **** [Pipeline] sh [s_example] Running shell script + echo Username: ****, Password: bar$baz Username: ****, Password: bar$baz
- depends on
-
JENKINS-41225 durable-task 1.13 is failing with remote Windows accessed through Cygwin sshd.
- In Review
- is blocked by
-
JENKINS-41339 Environment variables referencing other variables broken
- Reopened
- relates to
-
JENKINS-27040 Bound variables strip multiple dollar signs
- Resolved
-
JENKINS-61950 Environment variables with '$' have '$$' when used in sh step inside a container step.
- Resolved
- links to