Skip to content

Commit

Permalink
Revert "JENKINS-49812 Escape shell special characters" (#108)
Browse files Browse the repository at this point in the history
This reverts commit 047f191.
  • Loading branch information
jonesbusy authored Jul 30, 2023
1 parent f08581e commit 4fe719f
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,11 @@ public T setVaultCredentials(StandardCredentials vaultCredentials) {
protected ArgumentListBuilder prependPasswordCredentials(ArgumentListBuilder args) {
if (credentials instanceof UsernamePasswordCredentials) {
UsernamePasswordCredentials passwordCredentials = (UsernamePasswordCredentials)credentials;
args.add("sshpass").addMasked("-p" + escapeSpecialCharacters(Secret.toString(passwordCredentials.getPassword())));
args.add("sshpass").addMasked("-p" + Secret.toString(passwordCredentials.getPassword()));
}
return args;
}

protected String escapeSpecialCharacters(String input) {
return input.replaceAll("[!\\\"#$%&'()*+,-./:;<=>?@[\\\\\\\\]^`{|}~]", "\\\\$0");
}

protected ArgumentListBuilder appendCredentials(ArgumentListBuilder args)
throws IOException, InterruptedException
{
Expand Down

0 comments on commit 4fe719f

Please sign in to comment.