Skip to content

Commit

Permalink
Merge pull request #614 from ArnoStiefvater/all-options-for-nasl
Browse files Browse the repository at this point in the history
Move more preferences to gvm-libs
  • Loading branch information
ArnoStiefvater authored Oct 27, 2020
2 parents ea67a46 + da1c829 commit 659d07c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
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

0 comments on commit 659d07c

Please sign in to comment.