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

Remove db init warning that no longer makes sense #1044

Merged
merged 3 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -97,6 +97,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add user limits on hosts and ifaces to OSP prefs [#1033](https://github.com/greenbone/gvmd/pull/1033)
- Fix order of tar options in gvm-lsc-deb-creator.sh [#1034](https://github.com/greenbone/gvmd/pull/1034)
- Fix handling of termination signals [#1034](https://github.com/greenbone/gvmd/pull/1034)
- Remove db init warning that no longer makes sense [#1044](https://github.com/greenbone/gvmd/pull/1044)

### Removed
- Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)
Expand Down
18 changes: 0 additions & 18 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -15805,7 +15805,6 @@ check_db_versions ()
{
char *database_version;
int scap_db_version, cert_db_version;
long long int count;

database_version = sql_string ("SELECT value FROM %s.meta"
" WHERE name = 'database_version';",
Expand All @@ -15826,24 +15825,7 @@ check_db_versions ()
return -2;
}
g_free (database_version);

/* Check that the database was initialised from the scanner.
*
* This can also fail after a migration, for example if the database
* was created before NVT preferences were cached in the database.
*/

if (sql_int64 (&count,
"SELECT count(*) FROM %s.meta"
" WHERE name = 'nvts_feed_version'"
" OR name = 'nvt_preferences_enabled';",
sql_schema ())
|| count < 2)
g_warning ("database must be initialised from scanner");
}
else
/* Assume database is missing. */
g_warning ("database must be initialised from scanner");

/* Check SCAP database version. */

Expand Down
13 changes: 0 additions & 13 deletions src/manage_sql_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,19 +1604,6 @@ manage_nvt_preference_add (const char* name, const char* value)
g_free (quoted_value);
}

/**
* @brief Enable the NVT preferences.
*/
void
manage_nvt_preferences_enable ()
{
sql ("DELETE FROM %s.meta WHERE name = 'nvt_preferences_enabled';",
sql_schema ());
sql ("INSERT INTO %s.meta (name, value)"
" VALUES ('nvt_preferences_enabled', 1);",
sql_schema ());
}

/**
* @brief Initialise an NVT preference iterator.
*
Expand Down