dialAgent returns an ssh.Agent client. It uses the SSH_AUTH_SOCK to connect to the agent.
()
| 13 | // dialAgent returns an ssh.Agent client. It uses the SSH_AUTH_SOCK to connect |
| 14 | // to the agent. |
| 15 | func dialAgent() (*Agent, error) { |
| 16 | socket := os.Getenv("SSH_AUTH_SOCK") |
| 17 | conn, err := net.Dial("unix", socket) // #nosec G704 -- SSH_AUTH_SOCK points to a local Unix domain socket path |
| 18 | if err != nil { |
| 19 | return nil, errors.Wrap(err, "error connecting with ssh-agent") |
| 20 | } |
| 21 | return &Agent{ |
| 22 | ExtendedAgent: agent.NewClient(conn), |
| 23 | Conn: conn, |
| 24 | }, nil |
| 25 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…