Skip to content

Commit

Permalink
Fixed bug with incorrect handling of unconfigured SSH agent
Browse files Browse the repository at this point in the history
  • Loading branch information
MOZGIII committed Sep 26, 2016
1 parent cdee5e6 commit 0f5e8c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ssh_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dphx

import (
"io/ioutil"
"log"
"net"
"os"

Expand Down Expand Up @@ -78,6 +79,11 @@ func (s SSHConfig) addAuthsForKeys(auths []ssh.AuthMethod) ([]ssh.AuthMethod, er
}

func (s SSHConfig) addSignersForAgent(signers []ssh.Signer) ([]ssh.Signer, error) {
if s.AgentAddr == "" {
log.Println("WARNING: SSH agent connection not configured, not using agent auth")
return signers, nil
}

sock, err := net.Dial("unix", s.AgentAddr)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0f5e8c1

Please sign in to comment.