diff --git a/CHANGELOG.md b/CHANGELOG.md index 492f72206..fe0959514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Command cleanup-report-formats for --optimize option [#652](https://github.com/greenbone/gvmd/pull/652) - Document container tasks in GMP doc [#688](https://github.com/greenbone/gvmd/pull/688) - Add lean option to GET_REPORTS [#745](https://github.com/greenbone/gvmd/pull/745) -- Add scanner relays and OSP sensor scanner type [#756](https://github.com/greenbone/gvmd/pull/756) +- Add scanner relays and OSP sensor scanner type [#756](https://github.com/greenbone/gvmd/pull/756) [#759](https://github.com/greenbone/gvmd/pull/759) ### Changed - Check if NVT preferences exist before inserting. [#406](https://github.com/greenbone/gvmd/pull/406) diff --git a/src/manage_sql.c b/src/manage_sql.c index 57a62340e..b4bc666f4 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -42639,7 +42639,11 @@ create_scanner (const char* name, const char *comment, const char *host, return 1; } - if (!unix_socket && itype == SCANNER_TYPE_GMP && credential_id == NULL) + if (!unix_socket + && itype == SCANNER_TYPE_GMP + && (credential_id == NULL + || strcmp (credential_id, "") == 0 + || strcmp (credential_id, "0") == 0)) { sql_rollback (); return 6; @@ -42649,7 +42653,9 @@ create_scanner (const char* name, const char *comment, const char *host, else { credential = 0; - if (credential_id) + if (credential_id + && strcmp (credential_id, "") + && strcmp (credential_id, "0")) { if (find_credential_with_permission (credential_id, &credential, "get_credentials")) diff --git a/src/manage_sql_configs.c b/src/manage_sql_configs.c index 6c6a65cf8..d667fb758 100644 --- a/src/manage_sql_configs.c +++ b/src/manage_sql_configs.c @@ -2538,6 +2538,8 @@ create_task_check_config_scanner (config_t config, scanner_t scanner) return 1; if (ctype == 0 && stype == SCANNER_TYPE_GMP) return 1; + if (ctype == 0 && stype == SCANNER_TYPE_OSP_SENSOR) + return 1; if (ctype == 1 && stype == SCANNER_TYPE_OSP) return 1; @@ -2615,6 +2617,10 @@ modify_task_check_config_scanner (task_t task, const char *config_id, if (stype == SCANNER_TYPE_GMP && ctype == 0) return 0; + /* OSP Sensor with OpenVAS config. */ + if (stype == SCANNER_TYPE_OSP_SENSOR && ctype == 0) + return 0; + /* Default Scanner with OpenVAS Config. */ if (scanner == 0 && ctype == 0) return 0;