MCPcopy Index your code
hub / github.com/smallstep/cli / dialAgent

Function dialAgent

internal/sshutil/agent_unix.go:15–25  ·  view source on GitHub ↗

dialAgent returns an ssh.Agent client. It uses the SSH_AUTH_SOCK to connect to the agent.

()

Source from the content-addressed store, hash-verified

13// dialAgent returns an ssh.Agent client. It uses the SSH_AUTH_SOCK to connect
14// to the agent.
15func 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}

Callers 1

DialAgentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…