This commit is contained in:
empathetic-alligator committed 2014-12-16 19:43:36 -05:00
commit 96828c25ac
3 files changed
+6 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
host_key
host_key.pub
ssh-chat
*.log
+2 -2
View File
@@ -95,7 +95,7 @@ func (c *Client) ColoredName() string {
// SysMsg sends a message in continuous format over the message channel
func (c *Client) SysMsg(msg string, args ...interface{}) {
c.Msg <- ContinuousFormat(systemMessageFormat, "-> "+fmt.Sprintf(msg, args...))
c.Send(ContinuousFormat(systemMessageFormat, "-> "+fmt.Sprintf(msg, args...)))
}
// Write writes the given message
@@ -256,7 +256,7 @@ func (c *Client) handleShell(channel ssh.Channel) {
c.SysMsg("Missing $NAME from: /nick $NAME")
}
case "/whois":
if len(parts) == 2 {
if len(parts) >= 2 {
client := c.Server.Who(parts[1])
if client != nil {
version := reStripText.ReplaceAllString(string(client.Conn.ClientVersion()), "")
+3
View File
@@ -80,6 +80,9 @@ func NewServer(privateKey []byte) (*Server, error) {
perm := &ssh.Permissions{Extensions: map[string]string{"fingerprint": fingerprint}}
return perm, nil
},
KeyboardInteractiveCallback: func(conn ssh.ConnMetadata, challenge ssh.KeyboardInteractiveChallenge) (*ssh.Permissions, error) {
return nil, nil
},
}
config.AddHostKey(signer)