fix(scan): add an error case for rpm -qa (#1109)

This commit is contained in:
Kota Kanbe
2020-12-30 08:05:14 +09:00
committed by GitHub
parent a206675f3e
commit aceb3f1826
2 changed files with 22 additions and 3 deletions

View File

@@ -317,6 +317,11 @@ func (o *redhatBase) parseInstalledPackagesLine(line string) (models.Package, er
return models.Package{},
xerrors.Errorf("Failed to parse package line: %s", line)
}
if strings.HasSuffix(line, "Permission denied") {
return models.Package{},
xerrors.Errorf("Failed to parse package line: %s", line)
}
ver := ""
epoch := fields[1]
if epoch == "0" || epoch == "(none)" {