Skip to content

Commit 10c4ba2

Browse files
committed
Entity encode password
TODO: do this consistently... Don't tell anyone, but the password wasn't xml-safe.
1 parent 564e080 commit 10c4ba2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

recipes/_worker-config-debian.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# Also, it needs to run on every reboot of the worker instance(s),
1313
# since jenkins's home dir is mounted on ephemeral storage (see chef/userdata/ubuntu-publish-c3.xlarge)
1414

15+
require 'cgi'
1516
require 'base64'
1617

1718
# debian is only used for publishing jobs (if we add debian nodes for public jobs, must copy stuff from _worker-config-rhel)
@@ -71,7 +72,7 @@
7172
variables({
7273
:sonatypePass => chef_vault_item("worker-publish", "sonatype")['pass'],
7374
:sonatypeUser => chef_vault_item("worker-publish", "sonatype")['user'],
74-
:privateRepoPass => chef_vault_item("worker-publish", "private-repo")['pass'],
75+
:privateRepoPass => CGI.escapeHTML(chef_vault_item("worker-publish", "private-repo")['pass']), # OMG more papercuts
7576
:privateRepoUser => chef_vault_item("worker-publish", "private-repo")['user'],
7677
:s3DownloadsPass => chef_vault_item("worker-publish", "s3-downloads")['pass'],
7778
:s3DownloadsUser => chef_vault_item("worker-publish", "s3-downloads")['user']

recipes/_worker-config-rhel.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# All rights reserved - Do Not Redistribute
88
#
99

10+
require 'cgi'
1011

1112
node["jenkinsHomes"].each do |jenkinsHome, workerConfig|
1213
jenkinsUser=workerConfig["jenkinsUser"]
@@ -25,7 +26,7 @@
2526
sensitive true
2627

2728
variables({
28-
:privateRepoPass => chef_vault_item("worker", "private-repo-public-jobs")['pass'],
29+
:privateRepoPass => CGI.escapeHTML(chef_vault_item("worker", "private-repo-public-jobs")['pass']),
2930
:privateRepoUser => chef_vault_item("worker", "private-repo-public-jobs")['user']
3031
})
3132
end

0 commit comments

Comments
 (0)