diff --git a/models/packages.go b/models/packages.go index 6f67f7fa..587c9f52 100644 --- a/models/packages.go +++ b/models/packages.go @@ -60,15 +60,6 @@ func (ps Packages) Merge(other Packages) Packages { return merged } -// FormatVersionsFromTo returns updatable packages -func (ps Packages) FormatVersionsFromTo() string { - ss := []string{} - for _, pack := range ps { - ss = append(ss, pack.FormatVersionFromTo()) - } - return strings.Join(ss, "\n") -} - // FormatUpdatablePacksSummary returns a summary of updatable packages func (ps Packages) FormatUpdatablePacksSummary() string { nUpdatable := 0 @@ -121,9 +112,12 @@ func (p Package) FormatNewVer() string { } // FormatVersionFromTo formats installed and new package version -func (p Package) FormatVersionFromTo() string { - return fmt.Sprintf("%s-%s - %s", - p.Name, p.FormatVer(), p.FormatNewVer()) +func (p Package) FormatVersionFromTo(notFixedYet bool) string { + to := p.FormatNewVer() + if notFixedYet { + to = "Not Fixed Yet" + } + return fmt.Sprintf("%s-%s - %s", p.Name, p.FormatVer(), to) } // FormatChangelog formats the changelog diff --git a/report/slack.go b/report/slack.go index 6926dfb2..141efbfd 100644 --- a/report/slack.go +++ b/report/slack.go @@ -189,7 +189,11 @@ func toSlackAttachments(r models.ScanResult) (attaches []*attachment) { new := []string{} for _, affected := range vinfo.AffectedPackages { if p, ok := r.Packages[affected.Name]; ok { - new = append(new, p.FormatNewVer()) + if affected.NotFixedYet { + new = append(new, "Not Fixed Yet") + } else { + new = append(new, p.FormatNewVer()) + } } else { new = append(new, "?") } diff --git a/report/tui.go b/report/tui.go index 5796dddc..ee3a554c 100644 --- a/report/tui.go +++ b/report/tui.go @@ -767,7 +767,7 @@ func detailLines() (string, error) { for _, affected := range vinfo.AffectedPackages { // packages detected by OVAL may not be actually installed if pack, ok := r.Packages[affected.Name]; ok { - packsVer = append(packsVer, pack.FormatVersionFromTo()) + packsVer = append(packsVer, pack.FormatVersionFromTo(affected.NotFixedYet)) } } sort.Strings(vinfo.CpeNames) diff --git a/report/util.go b/report/util.go index c90f23bc..78330578 100644 --- a/report/util.go +++ b/report/util.go @@ -219,7 +219,7 @@ No CVE-IDs are found in updatable packages. vuln.AffectedPackages.Sort() for _, affected := range vuln.AffectedPackages { if pack, ok := r.Packages[affected.Name]; ok { - packsVer = append(packsVer, pack.FormatVersionFromTo()) + packsVer = append(packsVer, pack.FormatVersionFromTo(affected.NotFixedYet)) } } sort.Strings(vuln.CpeNames)