Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-43931] Allow username/password workspaces with space in path
Prior fix only handled ssh passphrase protected private keys

Note that the issue is only visible on Windows and only with workspaces
whose full path includes a space.
  • Loading branch information
MarkEWaite committed May 3, 2017
1 parent 03989f1 commit 4f27a70
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -1665,7 +1665,7 @@ private File createUnixSshAskpass(SSHUserPrivateKey sshUser) throws IOException

/* Package protected for testability */
File createWindowsBatFile(String userName, String password) throws IOException {
File askpass = createTempFile("pass", ".bat");
File askpass = createTempFile("pass", ".bat", true);
try (PrintWriter w = new PrintWriter(askpass, Charset.defaultCharset().toString())) {
w.println("@set arg=%~1");
w.println("@if (%arg:~0,8%)==(Username) echo " + escapeWindowsCharsForUnquotedString(userName));
Expand Down

0 comments on commit 4f27a70

Please sign in to comment.