Skip to content

Commit

Permalink
Merge pull request #853 from mattmundell/refuse-old-configs
Browse files Browse the repository at this point in the history
Refuse to import config with missing NVT preference ID
  • Loading branch information
timopollmeier authored Nov 6, 2019
2 parents 3d081ad + b476528 commit 51900ac
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 @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Improve performance of GET_REPORTS [#801](https://github.com/greenbone/gvmd/pull/801) [#811](https://github.com/greenbone/gvmd/pull/811) [#817](https://github.com/greenbone/gvmd/pull/817)
- Speed up the HELP 'brief' case [#807](https://github.com/greenbone/gvmd/pull/807)
- Faster startup [#826](https://github.com/greenbone/gvmd/pull/826)
- Refuse to import config with missing NVT preference ID [#853](https://github.com/greenbone/gvmd/pull/853)

### Changed
- Update SCAP and CERT feed info in sync scripts [#810](https://github.com/greenbone/gvmd/pull/810)
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 @@ -2069,6 +2069,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 @@ -27219,6 +27219,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<version>20.04</version>
</change>

<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 51900ac

Please sign in to comment.