Skip to content

Commit

Permalink
Merge pull request #1064 from timopollmeier/host-preferences-master
Browse files Browse the repository at this point in the history
Do not ignore empty hosts_allow and ifaces_allow (master)
  • Loading branch information
timopollmeier authored Apr 28, 2020
2 parents 66ba702 + 20383eb commit 1927487
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Clean up NVTs set to name in cleanup-result-nvts [#1039](https://github.com/greenbone/gvmd/pull/1039)
- Improve validation of note and override ports [#1045](https://github.com/greenbone/gvmd/pull/1045)
- The internal list of current Local Security Checks for the Auto-FP feature was updated [#1054](https://github.com/greenbone/gvmd/pull/1054)
- Do not ignore empty hosts_allow and ifaces_allow [#1064](https://github.com/greenbone/gvmd/pull/1064)

### Fixed
- Add NULL check in nvts_feed_version_epoch [#768](https://github.com/greenbone/gvmd/pull/768)
Expand Down
14 changes: 10 additions & 4 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -4063,8 +4063,11 @@ add_user_scan_preferences (GHashTable *scanner_options)
else
name = NULL;

if (name)
g_hash_table_replace (scanner_options, name, hosts);
if (name
&& (hosts_allow || (hosts && strlen (hosts))))
g_hash_table_replace (scanner_options,
name,
hosts ? hosts : g_strdup (""));
else
g_free (hosts);

Expand All @@ -4079,8 +4082,11 @@ add_user_scan_preferences (GHashTable *scanner_options)
else
name = NULL;

if (name)
g_hash_table_replace (scanner_options, name, ifaces);
if (name
&& (ifaces_allow || (ifaces && strlen (ifaces))))
g_hash_table_replace (scanner_options,
name,
ifaces ? ifaces : g_strdup (""));
else
g_free (ifaces);
}
Expand Down

0 comments on commit 1927487

Please sign in to comment.