fix(scanner): do not attach tty because there is no need to enter ssh password

This commit is contained in:
MaineK00n
2023-01-19 02:55:04 +09:00
parent a9c82b43e5
commit a6fba3ed55
2 changed files with 8 additions and 8 deletions

View File

@@ -185,7 +185,7 @@ func sshExecExternal(c config.ServerInfo, cmd string, sudo bool) (result execRes
return execResult{Error: err}
}
args := []string{"-tt"}
var args []string
if c.SSHConfigPath != "" {
args = append(args, "-F", c.SSHConfigPath)
@@ -280,7 +280,7 @@ func dockerShell(family string) string {
func decorateCmd(c config.ServerInfo, cmd string, sudo bool) string {
if sudo && c.User != "root" && !c.IsContainer() {
cmd = fmt.Sprintf("sudo -S %s", cmd)
cmd = fmt.Sprintf("sudo %s", cmd)
}
// If you are using pipe and you want to detect preprocessing errors, remove comment out
@@ -306,7 +306,7 @@ func decorateCmd(c config.ServerInfo, cmd string, sudo bool) string {
c.Container.Name, dockerShell(c.Distro.Family), cmd)
// LXC required root privilege
if c.User != "root" {
cmd = fmt.Sprintf("sudo -S %s", cmd)
cmd = fmt.Sprintf("sudo %s", cmd)
}
}
}