Skip to content

Commit

Permalink
fetch: handle bare file urls not ending in .rules
Browse files Browse the repository at this point in the history
If a URL is a bare file, and does not end in .rules, Suricata-Update
will ignore it.  Such URLs might look like:

- https://<misp>/1011

Ticket: #3664
  • Loading branch information
jasonish committed Feb 29, 2024
1 parent 61bb66f commit 372f944
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions suricata/update/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ def extract_files(self, filename):

# The file is not an archive, treat it as an individual file.
basename = os.path.basename(filename).split("-", 1)[1]
if not basename.endswith(".rules"):
basename = "{}.rules".format(basename)
files = {}
files[basename] = open(filename, "rb").read()
return files
Expand Down

0 comments on commit 372f944

Please sign in to comment.