Skip to content

Commit

Permalink
Avoid to set an entrypoint when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jul 15, 2016
1 parent 1cd3a85 commit 4ac4dd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (c *Client) HandleChannelRequests(channel ssh.Channel, requests <-chan *ssh
}
ok = true

entrypoint := c.Server.DefaultShell
entrypoint := ""
if c.Config.EntryPoint != "" {
entrypoint = c.Config.EntryPoint
}
Expand All @@ -265,6 +265,10 @@ func (c *Client) HandleChannelRequests(channel ssh.Channel, requests <-chan *ssh
args = c.Config.Command
}

if entrypoint == "" && len(args) == 0 {
args = []string{c.Server.DefaultShell}
}

c.runCommand(channel, entrypoint, args)

case "exec":
Expand Down

0 comments on commit 4ac4dd0

Please sign in to comment.