From: Jason Ish Date: Mon, 6 Nov 2017 04:27:01 +0000 (-0600) Subject: fix ET Open by default logic... X-Git-Tag: 1.0.0a1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee7d92e36a0618f8fbb760ac7f89122945123a38;p=thirdparty%2Fsuricata-update.git fix ET Open by default logic... Somewhere along the line the behaviour of loading ET Open if no other URLs were present was lost. Re-add this default behaviour. Loading ET-Open by default will happen if: - no --urls passed on the command line - no sources provided in the configuration - no etpro code given --- diff --git a/suricata/update/main.py b/suricata/update/main.py index 6ee7ea0..da4ab49 100644 --- a/suricata/update/main.py +++ b/suricata/update/main.py @@ -906,14 +906,6 @@ def load_sources(config, suricata_version): urls = [] - # If --etopen was provided on the command line, add it. - if config.get("etopen"): - urls.append(resolve_etopen_url(suricata_version)) - - # If --etpro was provided on the command line, add it. - if config.get("etpro"): - urls.append(resolve_etpro_url(config.get("etpro"), suricata_version)) - # Add any URLs added with the --url command line parameter. if config.args.url: for url in config.args.url: @@ -941,6 +933,14 @@ def load_sources(config, suricata_version): else: logger.error("Unknown source type: %s", source["type"]) + # If --etpro, add it. + if config.get("etpro"): + urls.append(resolve_etpro_url(config.get("etpro"), suricata_version)) + + # If --etopen or urls is still empty, add ET Open. + if config.get("etopen") or not urls: + urls.append(resolve_etopen_url(suricata_version)) + # Converting the URLs to a set removed dupes. urls = set(urls)