rpm

package
v0.0.0-...-e85a4bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(chk Checker, pkg, distro, cve string) (bool, error)

Check will parse package and distro and call given checker to return

func FilterFixedPackages

func FilterFixedPackages(chk Checker, pkgs []string, distro, cve string) ([]string, error)

FilterFixedPackages will return those packages which haven't been fixed already on the given distro and for a given cve if some package can't be parsed as an rpm package, it will not be checked and will be included in the output list

func LabelCompare

func LabelCompare(l1, l2 Label) int

LabelCompare returns 0 if the two packages have the same label, -1 if l1 < l2 and 1 of l1 > l2.

func RHELWFN

func RHELWFN(rpm *Package) (*wfn.Attributes, error)

func ToWFN

func ToWFN(attr *wfn.Attributes, s string) error

ToWFN parses CPE name from RPM package name

Types

type Checker

type Checker interface {
	// Check should return whether a given package on distribution is fixed for some CVE
	Check(pkg *Package, distro *wfn.Attributes, cve string) bool
}

Checker knows how to verify whether some package has been fixed or not

func CheckAll

func CheckAll(chks ...Checker) Checker

CheckAll returns a Checker which will return true if all of the underlying checkers returns true

func CheckAny

func CheckAny(chks ...Checker) Checker

CheckAny returns a Checker which will return true if any of the underlying checkers returns true

type Label

type Label struct {
	Epoch   string
	Version string
	Release string
}

Label is part of the package and allows us to commpare two RPM packages

type Package

type Package struct {
	Name string
	Label
	Arch string
}

Package represents one RPM package

func Parse

func Parse(pkg string) (*Package, error)

Parse returns name, version, release and architecture parsed from RPM package name NEVRA: https://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/

func ParseRPMAndRHELWFN

func ParseRPMAndRHELWFN(pkg string) (*Package, *wfn.Attributes, error)

func (*Package) String

func (p *Package) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL