Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refuse to import config with missing NVT preference ID #853

Merged
merged 5 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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