Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug reporting that a vulnerability exists in the wrong package. #409

Closed
wants to merge 2 commits into from
Closed

Fixed a bug reporting that a vulnerability exists in the wrong package. #409

wants to merge 2 commits into from

Conversation

usiusi360
Copy link
Contributor

@usiusi360 usiusi360 commented Mar 31, 2017

The output format of yum has changed.

What did you implement:

Closes #408

How did you implement it:

I made it possible to deal with even if the package name was divided into multiple lines.

How can we verify it:

./vuls tui

Todos:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

Copy link
Member

@kotakanbe kotakanbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Please fix it.

scan/redhat.go Outdated
line = o.regexpReplace(line, `^\*\*\sNo\sChangeLog\sfor:.*`, "")
lines = append(lines, line)
if yumChangelogFirstPattern.MatchString(line) {
line = o.regexpReplace(line, `^ChangeLog for: `, "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use stirngs.TrimPrefix

scan/redhat.go Outdated
line = o.regexpReplace(line, `^ChangeLog for: `, "")
line = o.regexpReplace(line, `^\*\*\sNo\sChangeLog\sfor:.*`, "")
lines = append(lines, line)
if yumChangelogFirstPattern.MatchString(line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Strings.HasPrefix

scan/redhat.go Outdated
lines = append(lines, line)
if yumChangelogFirstPattern.MatchString(line) {
line = o.regexpReplace(line, `^ChangeLog for: `, "")
if yumChangelogLastPattern.MatchString(line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use strings.HasSuffix

scan/redhat.go Outdated
lines = append(lines, line)
}
} else if yumChangelogNextPattern.MatchString(line) {
line = o.regexpReplace(line, `^ {13}: `, "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use strings.TrimPrefix

scan/redhat.go Outdated
} else {
lines = append(lines, line)
}
} else if yumChangelogNextPattern.MatchString(line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use strings.HasPrefix

scan/redhat.go Outdated
}
} else if yumChangelogNextPattern.MatchString(line) {
line = o.regexpReplace(line, `^ {13}: `, "")
if yumChangelogLastPattern.MatchString(line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use strings.HasSuffix

tmpline = ""
}
} else {
line = o.regexpReplace(line, `^\*\*\sNo\sChangeLog\sfor:.*`, "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please Use strings.HasPrefix

@kotakanbe kotakanbe added this to the v0.4.0 milestone Jun 27, 2017
@kotakanbe
Copy link
Member

This issue will be fixed in #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants