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

Move more preferences to gvm-libs #614

Merged
merged 3 commits into from
Oct 27, 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 @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Store results in main_kb instead of host_kb. [#550](https://github.com/greenbone/openvas/pull/550)
- Also use internal function name in some nasl log messages. [#611](https://github.com/greenbone/openvas/pull/611)
- Move more scanner preferences to gvm-libs to make them available for openvas-nasl. [#614](https://github.com/greenbone/openvas/pull/614)

### Removed
- Use the nvticache name from gvm-libs, defined in nvticache.h. [#578](https://github.com/greenbone/openvas/pull/578)
Expand Down
5 changes: 3 additions & 2 deletions nasl/nasl.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ main (int argc, char **argv)
nasl_trace_fp = fp;
}
}
if (with_safe_checks)
prefs_set ("safe_checks", "yes");

gcrypt_init ();
openvas_SSL_init ();
Expand Down Expand Up @@ -341,6 +339,9 @@ main (int argc, char **argv)
g_free (port_range);
}

if (with_safe_checks)
prefs_set ("safe_checks", "yes");

pos = 0; // Append the item on the right side of the list
while ((host = gvm_hosts_next (hosts)))
{
Expand Down
19 changes: 3 additions & 16 deletions src/openvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,16 @@ typedef struct

/**
* @brief Default values for scanner options. Must be NULL terminated.
*
* Only include options which are dependent on CMake variables.
* Empty options must be "\0", not NULL, to match the behavior of prefs_init.
*/
static openvas_option openvas_defaults[] = {
{"plugins_folder", OPENVAS_NVT_DIR},
{"include_folders", OPENVAS_NVT_DIR},
{"max_hosts", "30"},
{"max_checks", "10"},
{"log_whole_attack", "no"},
{"log_plugins_name_at_load", "no"},
{"optimize_test", "yes"},
{"non_simult_ports", "139, 445, 3389, Services/irc"},
{"plugins_timeout", G_STRINGIFY (NVT_TIMEOUT)},
{"scanner_plugins_timeout", G_STRINGIFY (SCANNER_NVT_TIMEOUT)},
{"safe_checks", "yes"},
{"auto_enable_dependencies", "yes"},
{"drop_privileges", "no"},
// Empty options must be "\0", not NULL, to match the behavior of
// prefs_init.
{"report_host_details", "yes"},
{"db_address", KB_PATH_DEFAULT},
{"vendor_version", "\0"},
{"test_alive_hosts_only", "no"},
{"debug_tls", "0"},
{"allow_simult_ips_same_host", "yes"},
{NULL, NULL}};

static void
Expand Down