gofmt cleanup

This commit is contained in:
Russ Magee 2018-11-28 21:03:20 -08:00
parent 103d76989e
commit b6a22ce64a
3 changed files with 11 additions and 12 deletions

View File

@ -33,7 +33,7 @@ type KEXAlg uint8
// Extended exit status codes - indicate comm/pty issues
// rather than remote end normal UNIX exit codes
const (
CSENone = 1024 + iota
CSENone = 1024 + iota
CSETruncCSO // No CSOExitStatus in payload
CSEStillOpen // Channel closed unexpectedly
CSEExecFail // cmd.Start() (exec) failed

View File

@ -79,8 +79,8 @@ type (
m *sync.Mutex // (internal)
c *net.Conn // which also implements io.Reader, io.Writer, ...
immClose bool
cipheropts uint32 // post-KEx cipher/hmac options
opts uint32 // post-KEx protocol options (caller-defined)
cipheropts uint32 // post-KEx cipher/hmac options
opts uint32 // post-KEx protocol options (caller-defined)
WinCh chan WinSize
Rows uint16
Cols uint16
@ -891,9 +891,9 @@ func (hc Conn) Read(b []byte) (n int, err error) {
logger.LogDebug(fmt.Sprintf("[Attempt to write data to closed tun [%d:%d]", lport, rport))
}
} else if ctrlStatOp == CSOTunKeepAlive {
// client side has sent keepalive for tunnels -- if client
// dies or exits unexpectedly the absence of this will
// let the server know to hang up on Dial()ed server rports.
// client side has sent keepalive for tunnels -- if client
// dies or exits unexpectedly the absence of this will
// let the server know to hang up on Dial()ed server rports.
_ = binary.BigEndian.Uint16(payloadBytes[0:2])
//logger.LogDebug(fmt.Sprintf("[Server] Got CSOTunKeepAlive"))
for _, t := range *hc.tuns {

View File

@ -56,8 +56,8 @@ func runClientToServerCopyAs(who, ttype string, conn *hkexnet.Conn, fpath string
// Investigate -- rlm 2018-01-26)
os.Clearenv()
os.Setenv("HOME", u.HomeDir) // nolint: gosec,errcheck
os.Setenv("TERM", ttype) // nolint: gosec,errcheck
os.Setenv("HKEXSH", "1") // nolint: gosec,errcheck
os.Setenv("TERM", ttype) // nolint: gosec,errcheck
os.Setenv("HKEXSH", "1") // nolint: gosec,errcheck
var c *exec.Cmd
cmdName := "/bin/tar"
@ -309,10 +309,9 @@ func runShellAs(who, ttype string, cmd string, interactive bool, conn *hkexnet.C
}
// #gv:s/label=\"runShellAs\$4\"/label=\"deferChaffShutdown\"/
defer func() {
conn.DisableChaff()
conn.ShutdownChaff()
conn.DisableChaff()
conn.ShutdownChaff()
}()
// ..and the pty to stdout.
// This may take some time exceeding that of the
@ -548,7 +547,7 @@ func main() {
hc.Write([]byte{1}) // nolint: gosec,errcheck
} else {
logger.LogNotice(fmt.Sprintln("Invalid user", string(rec.Who()))) // nolint: errcheck,gosec
hc.Write([]byte{0}) // nolint: gosec,errcheck
hc.Write([]byte{0}) // nolint: gosec,errcheck
return
}