Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc2910e1

Browse files
committed
Use hard coded values for SSH env vars
1 parent09b173b commitc2910e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎agent/agent.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,12 @@ func (a *agent) handleSSHSession(session ssh.Session) (retErr error) {
424424
returnerr
425425
}
426426
// Set SSH connection environment variables, from the clients perspective.
427-
srcAddr,srcPort:=addrToSSHEnvAddr(session.RemoteAddr())
428-
dstAddr,dstPort:=addrToSSHEnvAddr(session.LocalAddr())
427+
// Set SSH connection environment variables (these are also set by OpenSSH
428+
// and thus expected to be present by SSH clients). Since the agent does
429+
// networking in-memory, trying to provide accurate values here would be
430+
// nonsensical. For now, we hard code these values so that they're present.
431+
srcAddr,srcPort:="0.0.0.0","0"
432+
dstAddr,dstPort:="0.0.0.0","0"
429433
cmd.Env=append(cmd.Env,fmt.Sprintf("SSH_CLIENT=%s %s %s",srcAddr,srcPort,dstPort))
430434
cmd.Env=append(cmd.Env,fmt.Sprintf("SSH_CONNECTION=%s %s %s %s",srcAddr,srcPort,dstAddr,dstPort))
431435

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp