]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
Fix default for the --ignore flag 132/head
authorVidushi Agrawal <vidushi229@gmail.com>
Fri, 15 Mar 2019 21:56:04 +0000 (03:26 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 26 Mar 2019 18:30:35 +0000 (00:00 +0530)
suricata-update doesn't properly load some sections in update.yaml file.
Example:
Even after setting the following in update.yaml
```
ignore:
  - "*deleted.rules"
  - "*pop3.rules"
```

```
$ ./bin/suricata-update -v
```
generates
```
16/3/2019 -- 03:14:59 - <Debug> -- Parsing rules/emerging-pop3.rules.
16/3/2019 -- 03:15:01 - <Debug> -- Parsing rules/emerging-deleted.rules.
```
which means the files do not get ignored. It seems that the code loading command line parameters override previous settings even when no parameters are given.
Thus changing the default for the --ignore flag from "[]" to "None", fixes the issue.

Closes Redmine ticket #2851.

suricata/update/main.py

index cdef34a55d5ce3cf9bee84fcd90a4296db475fef..e81646ee9b115a649eff2fe37097de5c0090c137 100644 (file)
@@ -1102,7 +1102,7 @@ def _main():
                                help="Filename of drop rules filters")
     
     update_parser.add_argument("--ignore", metavar="<pattern>", action="append",
-                               default=[],
+                               default=None,
                                help="Filenames to ignore (can be specified multiple times; default: *deleted.rules)")
     update_parser.add_argument("--no-ignore", action="store_true",
                                default=False,