Change CveContents data type to map

This commit is contained in:
Kota Kanbe
2017-05-06 04:52:19 +09:00
committed by kota kanbe
parent 12c2d3cbc6
commit f26b61d773
7 changed files with 66 additions and 62 deletions

View File

@@ -293,7 +293,7 @@ func (l *base) convertToModel() models.ScanResult {
// Avoid null slice being null in JSON
for i := range l.VulnInfos {
l.VulnInfos[i].NilSliceToEmpty()
l.VulnInfos[i].NilToEmpty()
}
return models.ScanResult{

View File

@@ -148,6 +148,9 @@ func parallelExec(fn func(osTypeInterface) error, timeoutSec ...int) {
}
func exec(c conf.ServerInfo, cmd string, sudo bool, log ...*logrus.Entry) (result execResult) {
logger := getSSHLogger(log...)
logger.Debugf("Executing... %s", strings.Replace(cmd, "\n", "", -1))
if c.Port == "local" &&
(c.Host == "127.0.0.1" || c.Host == "localhost") {
result = localExec(c, cmd, sudo)
@@ -157,7 +160,6 @@ func exec(c conf.ServerInfo, cmd string, sudo bool, log ...*logrus.Entry) (resul
result = sshExecExternal(c, cmd, sudo)
}
logger := getSSHLogger(log...)
logger.Debug(result)
return
}