Skip to content

Commit

Permalink
[Fix JENKINS-29813] Use Bourne shell rather than bash for ASKPASS answer
Browse files Browse the repository at this point in the history
Bourne shell does not allow a variable to be declared and exported
with a single command. This uses a statement to declare and a
statement to export.
  • Loading branch information
MarkEWaite committed Aug 6, 2015
1 parent 938f9a7 commit 4a48601
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -1562,7 +1562,10 @@ private File createUnixGitSSH(File key, String user) throws IOException {
PrintWriter w = new PrintWriter(ssh);
w.println("#!/bin/sh");
// ${SSH_ASKPASS} might be ignored if ${DISPLAY} is not set
w.println("[ -z \"${DISPLAY}\" ] && export DISPLAY=:123.456");
w.println("if [ -z \"${DISPLAY}\" ]; then");
w.println(" DISPLAY=:123.456");
w.println(" export DISPLAY");
w.println("fi");
w.println("ssh -i \"" + key.getAbsolutePath() + "\" -l \"" + user + "\" -o StrictHostKeyChecking=no \"$@\"");
w.close();
ssh.setExecutable(true);
Expand Down

0 comments on commit 4a48601

Please sign in to comment.