Add option for it get cve detail from cve.sqlite3.

It is an error in go-cve-dictionary API when result of scan is many.
This commit is contained in:
hirokazu yamada
2016-05-31 01:05:02 +09:00
parent b057ed3e77
commit a5549fb500
3 changed files with 50 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ type Config struct {
HTTPProxy string `valid:"url"`
DBPath string
CveDBPath string
// CpeNames []string
// SummaryMode bool
UseYumPluginSecurity bool
@@ -63,6 +64,13 @@ func (c Config) Validate() bool {
}
}
if len(c.CveDBPath) != 0 {
if ok, _ := valid.IsFilePath(c.CveDBPath); !ok {
errs = append(errs, fmt.Errorf(
"SQLite3 DB(Cve Doctionary) path must be a *Absolute* file path. dbpath: %s", c.CveDBPath))
}
}
_, err := valid.ValidateStruct(c)
if err != nil {
errs = append(errs, err)