mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
SSH Config Panic Handler (#1571)
Match statements in files that are included in an ssh config still seem to cause panics with the ssh_config library. This adds a panic handler to catch them, and prevent the app from crashing. It does not resolve the underlying issue which will need to be done later.
This commit is contained in:
parent
f12a2266b5
commit
2e2a6491e8
@ -23,6 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/kevinburke/ssh_config"
|
"github.com/kevinburke/ssh_config"
|
||||||
"github.com/skeema/knownhosts"
|
"github.com/skeema/knownhosts"
|
||||||
|
"github.com/wavetermdev/waveterm/pkg/panichandler"
|
||||||
"github.com/wavetermdev/waveterm/pkg/trimquotes"
|
"github.com/wavetermdev/waveterm/pkg/trimquotes"
|
||||||
"github.com/wavetermdev/waveterm/pkg/userinput"
|
"github.com/wavetermdev/waveterm/pkg/userinput"
|
||||||
"github.com/wavetermdev/waveterm/pkg/util/shellutil"
|
"github.com/wavetermdev/waveterm/pkg/util/shellutil"
|
||||||
@ -750,7 +751,13 @@ func combineSshKeywords(userProvidedOpts *wshrpc.ConnKeywords, configKeywords *w
|
|||||||
// note that a `var == "yes"` will default to false
|
// note that a `var == "yes"` will default to false
|
||||||
// but `var != "no"` will default to true
|
// but `var != "no"` will default to true
|
||||||
// when given unexpected strings
|
// when given unexpected strings
|
||||||
func findSshConfigKeywords(hostPattern string) (*wshrpc.ConnKeywords, error) {
|
func findSshConfigKeywords(hostPattern string) (connKeywords *wshrpc.ConnKeywords, outErr error) {
|
||||||
|
defer func() {
|
||||||
|
err := panichandler.PanicHandler("sshclient:find-ssh-config-keywords")
|
||||||
|
if err != nil {
|
||||||
|
outErr = err
|
||||||
|
}
|
||||||
|
}()
|
||||||
WaveSshConfigUserSettings().ReloadConfigs()
|
WaveSshConfigUserSettings().ReloadConfigs()
|
||||||
sshKeywords := &wshrpc.ConnKeywords{}
|
sshKeywords := &wshrpc.ConnKeywords{}
|
||||||
var err error
|
var err error
|
||||||
|
Loading…
Reference in New Issue
Block a user