mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Add filename conformity check
* Add util function to check a filename for confirming to csaf-v2.0-csd02. * Add code to reject bad filenames in provider, checker, aggregator and uploader.
This commit is contained in:
parent
f6fa366ee5
commit
17f22855ee
6 changed files with 99 additions and 9 deletions
|
|
@ -419,7 +419,13 @@ func (w *worker) mirrorFiles(tlpLabel *csaf.TLPLabel, files []string) error {
|
|||
log.Printf("error: %s\n", err)
|
||||
continue
|
||||
}
|
||||
filename := util.CleanFileName(filepath.Base(u.Path))
|
||||
|
||||
// Ignore not confirming filenames.
|
||||
filename := filepath.Base(u.Path)
|
||||
if !util.ConfirmingFileName(filename) {
|
||||
log.Printf("Not confirming filename %q. Ignoring.\n", filename)
|
||||
continue
|
||||
}
|
||||
|
||||
var advisory interface{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue