Skip to content

Commit

Permalink
Fix runtime error on Linux (fix #38)
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Oct 7, 2015
1 parent b92b51e commit f32315c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ GLOBAL OPTIONS:

### master (unreleased)

* Fix runtime error on Linux ([#38](https://github.com/moul/ssh2docker/issues/38))
* Support of 'ssh2docker --password-auth-script' options ([#28](https://github.com/moul/ssh2docker/issues/28))
* Add docker support ([#17](https://github.com/moul/ssh2docker/issues/17))
* Add GOXC support to build binaries for multiple architectures ([#18](https://github.com/moul/ssh2docker/issues/18))
Expand Down
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Client struct {
Pty, Tty *os.File
Env Environment
Config *ClientConfig
ClientID string
}

type ClientConfig struct {
Expand All @@ -39,6 +40,7 @@ type ClientConfig struct {
func NewClient(conn *ssh.ServerConn, chans <-chan ssh.NewChannel, reqs <-chan *ssh.Request, server *Server) *Client {
client := Client{
Idx: clientCounter,
ClientID: conn.RemoteAddr().String(),
ChannelIdx: 0,
Conn: conn,
Chans: chans,
Expand All @@ -58,6 +60,8 @@ func NewClient(conn *ssh.ServerConn, chans <-chan ssh.NewChannel, reqs <-chan *s
},
}

server.ClientConfigs[client.ClientID] = client.Config

clientCounter++

logrus.Infof("NewClient (%d): User=%q, ClientVersion=%q", client.Idx, conn.User(), fmt.Sprintf("%x", conn.ClientVersion()))
Expand Down

0 comments on commit f32315c

Please sign in to comment.