feat(scanner): skip ssh config validation if G option is unknown option (#1632)

This commit is contained in:
MaineK00n
2023-04-04 18:50:17 +09:00
committed by GitHub
parent e506125017
commit abdb081af7

View File

@@ -419,6 +419,10 @@ func validateSSHConfig(c *config.ServerInfo) error {
logging.Log.Debugf("Executing... %s", strings.Replace(sshConfigCmd, "\n", "", -1))
configResult := localExec(*c, sshConfigCmd, noSudo)
if !configResult.isSuccess() {
if strings.Contains(configResult.Stderr, "unknown option -- G") {
logging.Log.Warn("SSH configuration validation is skipped. To enable validation, G option introduced in OpenSSH 6.8 must be enabled.")
return nil
}
return xerrors.Errorf("Failed to print SSH configuration. err: %w", configResult.Error)
}
sshConfig := parseSSHConfiguration(configResult.Stdout)