@@ -2,7 +2,6 @@ package oracle
2
2
3
3
import (
4
4
"context"
5
- "strings"
6
5
"time"
7
6
8
7
version "github.com/knqyf263/go-rpm-version"
@@ -43,16 +42,6 @@ func NewScanner() *Scanner {
43
42
}
44
43
}
45
44
46
- func extractKsplice (v string ) string {
47
- subs := strings .Split (strings .ToLower (v ), "." )
48
- for _ , s := range subs {
49
- if strings .HasPrefix (s , "ksplice" ) {
50
- return s
51
- }
52
- }
53
- return ""
54
- }
55
-
56
45
// Detect scans and return vulnerability in Oracle scanner
57
46
func (s * Scanner ) Detect (ctx context.Context , osVer string , _ * ftypes.Repository , pkgs []ftypes.Package ) ([]types.DetectedVulnerability , error ) {
58
47
osVer = osver .Major (osVer )
@@ -69,10 +58,9 @@ func (s *Scanner) Detect(ctx context.Context, osVer string, _ *ftypes.Repository
69
58
installed := utils .FormatVersion (pkg )
70
59
installedVersion := version .NewVersion (installed )
71
60
for _ , adv := range advisories {
72
- // when one of them doesn't have ksplice, we'll also skip it
73
- // extract kspliceX and compare it with kspliceY in advisories
74
- // if kspliceX and kspliceY are different, we will skip the advisory
75
- if extractKsplice (adv .FixedVersion ) != extractKsplice (pkg .Release ) {
61
+ // We need to use only advisories from the same flavor as the package flavors.
62
+ // See more in https://github.com/aquasecurity/trivy/issues/1967
63
+ if oracleoval .PackageFlavor (adv .FixedVersion ) != oracleoval .PackageFlavor (pkg .Release ) {
76
64
continue
77
65
}
78
66
0 commit comments