Skip to content

Commit

Permalink
Merge pull request #292 from future-architect/fix-bug-amazon-linux
Browse files Browse the repository at this point in the history
Fix amazon linux scan stopped halfway
  • Loading branch information
kotakanbe authored Jan 12, 2017
2 parents a6912ca + 0416c3b commit 1f62dcf
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions scan/redhat.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,10 @@ func (o *redhat) scanUnsecurePackagesUsingYumPluginSecurity() (models.VulnInfos,
return nil, fmt.Errorf("Not implemented yet: %s, err: %s", o.Distro, err)
}

switch major {
case 5:
{
cmd = "yum --color=never list-security --security"
}
case 6, 7:
{
cmd = "yum --color=never updateinfo list available --security"
}
if o.Distro.Family == "centos" && major == 5 {
cmd = "yum --color=never list-security --security"
} else {
cmd = "yum --color=never updateinfo list available --security"
}
r = o.ssh(util.PrependProxyEnv(cmd), o.sudo())
if !r.isSuccess() {
Expand Down Expand Up @@ -628,15 +623,10 @@ func (o *redhat) scanUnsecurePackagesUsingYumPluginSecurity() (models.VulnInfos,
}

// get advisoryID(RHSA, ALAS) - CVE IDs
switch major {
case 5:
{
cmd = "yum --color=never info-sec"
}
case 6, 7:
{
cmd = "yum --color=never updateinfo --security update"
}
if o.Distro.Family == "centos" && major == 5 {
cmd = "yum --color=never info-sec"
} else {
cmd = "yum --color=never updateinfo --security update"
}
r = o.ssh(util.PrependProxyEnv(cmd), o.sudo())
if !r.isSuccess() {
Expand Down

0 comments on commit 1f62dcf

Please sign in to comment.