From 7cebaf8a76ccecb75edbe279c8dc996f1a1f3705 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Wed, 9 May 2018 16:45:03 +0900 Subject: [PATCH] Use servername for SSH ControlPath filename (#640) --- scan/executil.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scan/executil.go b/scan/executil.go index f223fca4..e90913b9 100644 --- a/scan/executil.go +++ b/scan/executil.go @@ -278,7 +278,7 @@ func sshExecExternal(c conf.ServerInfo, cmd string, sudo bool) (result execResul result.ExitStatus = 997 return } - controlPath := filepath.Join(home, ".vuls", `controlmaster-%r-%h.%p`) + controlPath := filepath.Join(home, ".vuls", `controlmaster-%r-`+c.ServerName+`.%p`) defaultSSHArgs := []string{ "-tt", @@ -296,11 +296,6 @@ func sshExecExternal(c conf.ServerInfo, cmd string, sudo bool) (result execResul args := append(defaultSSHArgs, fmt.Sprintf("%s@%s", c.User, c.Host)) args = append(args, "-p", c.Port) - - // if conf.Conf.Debug { - // args = append(args, "-v") - // } - if 0 < len(c.KeyPath) { args = append(args, "-i", c.KeyPath) args = append(args, "-o", "PasswordAuthentication=no")