mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
refuse to run with ssh -t or -tt, detect nil runPacket
This commit is contained in:
parent
935500f1f1
commit
fec7721e32
@ -243,6 +243,10 @@ func handleRemote() {
|
||||
sender.SendErrorPacket(fmt.Sprintf("invalid packet '%s' sent to mshell", pk.GetType()))
|
||||
return
|
||||
}
|
||||
if runPacket == nil {
|
||||
sender.SendErrorPacket(fmt.Sprintf("no run packet received"))
|
||||
return
|
||||
}
|
||||
cmd, err := shexec.RunCommand(runPacket, sender)
|
||||
if err != nil {
|
||||
sender.SendErrorPacket(fmt.Sprintf("error running command: %v", err))
|
||||
@ -311,6 +315,9 @@ func parseClientOpts() (*shexec.ClientOpts, error) {
|
||||
opts.SSHOptsTerm = true
|
||||
break
|
||||
}
|
||||
if argStr == "-t" || argStr == "-tt" {
|
||||
return nil, fmt.Errorf("mshell cannot run over ssh -t")
|
||||
}
|
||||
opts.SSHOpts = append(opts.SSHOpts, argStr)
|
||||
}
|
||||
if !opts.SSHOptsTerm {
|
||||
|
Loading…
Reference in New Issue
Block a user