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 unused be_nice scanner preference. #313

Merged
merged 2 commits into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 0 additions & 4 deletions doc/openvassd.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ x
.I max_hosts
so you need to find a balance between these two options. Note that launching too many plugins at the same time may disable the remote host, either temporarily (ie: inetd closes its ports) or definitely (the remote host crash because it is asked to do too many things at the same time), so be careful.

.IP be_nice
If this option is set to 'yes', then each child forked by openvassd will
nice(2) itself to a very low priority. This may speed up your scan as the main openvassd process will be able to continue to spew processes, and this guarantees that openvassd does not deprives other important processes from their resources.

.IP log_whole_attack
If this option is set to 'yes', openvassd will store the name, pid, date and target of each plugin launched. This is helpful for monitoring and debugging purpose, however this option might make openvassd fill your disk rather quickly.

Expand Down
22 changes: 0 additions & 22 deletions misc/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,6 @@ static struct csc_hook_s *csc_hooks;
*/
#define OVAS_CONNECTION_FROM_FD(fd) (connections + ((fd) -OPENVAS_FD_OFF))

static void
renice_myself (void)
{
static pid_t pid = 0;
pid_t cpid = getpid ();

if (pid != cpid)
{
int renice_result;
if (nice (0) >= 10)
return;
pid = cpid;
errno = 0;
renice_result = nice (1);
if (renice_result == -1 && errno != 0)
{
g_message ("Unable to renice process: %d", errno);
}
}
}

/**
* Same as perror(), but prefixes the data by our pid.
*/
Expand Down Expand Up @@ -978,7 +957,6 @@ open_stream_connection_ext (struct script_infos *args, unsigned int port,
case OPENVAS_ENCAPS_TLSv11:
case OPENVAS_ENCAPS_TLSv12:
case OPENVAS_ENCAPS_TLScustom:
renice_myself ();
cert = kb_item_get_str (kb, "SSL/cert");
key = kb_item_get_str (kb, "SSL/key");
passwd = kb_item_get_str (kb, "SSL/password");
Expand Down
11 changes: 0 additions & 11 deletions src/nasl_plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,6 @@ nasl_thread (struct script_infos *args)
GError *error = NULL;

nvticache_reset ();
if (prefs_get_bool ("be_nice"))
{
int nice_retval;
errno = 0;
nice_retval = nice (-5);
if (nice_retval == -1 && errno != 0)
{
g_debug ("Unable to renice process: %d", errno);
}
}

kb = args->key;
kb_lnk_reset (kb);
addr6_to_str (args->ip, ip_str);
Expand Down
11 changes: 0 additions & 11 deletions src/openvassd.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ static openvassd_option openvassd_defaults[] = {
{"include_folders", OPENVAS_NVT_DIR},
{"max_hosts", "30"},
{"max_checks", "10"},
{"be_nice", "no"},
{"log_whole_attack", "no"},
{"log_plugins_name_at_load", "no"},
{"optimize_test", "yes"},
Expand Down Expand Up @@ -476,16 +475,6 @@ scanner_thread (struct scan_globals *globals)
else
globals->scan_id = g_strdup (global_scan_id);

/* Everyone runs with a nicelevel of 10 */
if (prefs_get_bool ("be_nice"))
{
errno = 0;
if (nice (10) == -1 && errno != 0)
{
g_warning ("Unable to renice process: %d", errno);
}
}

handle_client (globals);

shutdown_and_exit:
Expand Down
2 changes: 1 addition & 1 deletion src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ is_scanner_only_pref (const char *pref)
"kb_location") // old name of db_address, ignore from old conf's
|| !strcmp (pref, "db_address") || !strcmp (pref, "negot_timeout")
|| !strcmp (pref, "force_pubkey_auth")
|| !strcmp (pref, "log_whole_attack") || !strcmp (pref, "be_nice")
|| !strcmp (pref, "log_whole_attack")
|| !strcmp (pref, "log_plugins_name_at_load")
|| !strcmp (pref, "nasl_no_signature_check")
/* Preferences starting with sys_ are scanner-side only. */
Expand Down