Skip to content

Commit

Permalink
Merge pull request #856 from mattmundell/refuse-old-configs-9.0
Browse files Browse the repository at this point in the history
Refuse to import config with missing NVT preference ID (9.0)
  • Loading branch information
mattmundell authored Nov 5, 2019
2 parents b3b0e10 + 111c9e5 commit 39c7698
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add option --optimize migrate-relay-sensors [#827](https://github.com/greenbone/gvmd/pull/827)
- Add host_id filter for tls_certificates [#835](https://github.com/greenbone/gvmd/pull/835)
- Allow use of public key auth in SCP alert [#845](https://github.com/greenbone/gvmd/pull/845)
- Refuse to import config with missing NVT preference ID [#856](https://github.com/greenbone/gvmd/pull/856)

### Changed
- Extend command line options for managing scanners [#815](https://github.com/greenbone/gvmd/pull/815)
Expand Down
4 changes: 4 additions & 0 deletions src/manage_sql_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2178,6 +2178,10 @@ config_insert_preferences (config_t config,
if (config_type == NULL || strcmp (config_type, "0") == 0)
{
/* NVT preference */

if (preference->id == NULL || *preference->id == '\0')
return -4;

/* OID:PrefID:PrefType:PrefName value */
sql ("INSERT INTO config_preferences"
" (config, type, name, value)"
Expand Down
11 changes: 11 additions & 0 deletions src/schema_formats/XML/GMP.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -27257,6 +27257,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

<!-- Compatibility changes between versions. -->

<change>
<command>CREATE_CONFIG</command>
<summary>NVT preferences without IDs are no longer accepted</summary>
<description>
<p>
Importing of old scan configs that do not specify an ID for their
NVT preferences is no longer allowed.
</p>
</description>
<version>9.0</version>
</change>
<change>
<command>GET_REPORTS</command>
<summary>Default of "details" attribute is now 0</summary>
Expand Down

0 comments on commit 39c7698

Please sign in to comment.