Skip to content

Commit 7772af1

Browse files
committed
Missing $SSH_AUTH_SOCK would indicate a serious problem.
1 parent 34806fa commit 7772af1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/cloudbees/jenkins/plugins/sshagent/exec/ExecRemoteAgent.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ public class ExecRemoteAgent implements RemoteAgent {
7272
}
7373
agentEnv = parseAgentEnv(new String(baos.toByteArray(), StandardCharsets.US_ASCII)); // TODO could include local filenames, better to look up remote charset
7474

75-
if (agentEnv.containsKey(AuthSocketVar))
75+
if (agentEnv.containsKey(AuthSocketVar)) {
7676
socket = agentEnv.get(AuthSocketVar);
77-
else
78-
socket = ""; // socket is not set
77+
} else {
78+
throw new AbortException(AuthSocketVar + " was not included");
79+
}
7980
}
8081

8182
/**

0 commit comments

Comments
 (0)