|
OpenVAS Scanner 23.40.3
|
Creates new threads. More...
#include "processes.h"#include "../misc/kb_cache.h"#include "debug_utils.h"#include "sighand.h"#include <errno.h>#include <glib.h>#include <gvm/base/logging.h>#include <gvm/util/mqtt.h>#include <setjmp.h>#include <signal.h>#include <stdlib.h>#include <string.h>#include <sys/wait.h>#include <time.h>#include <unistd.h>
Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "sd main" |
| GLib log domain. | |
Functions | |
| int | procs_cleanup_children (void) |
| iterates through ipcc and verify if a child is stopped or killed to free the file handler. | |
| static void | clean_procs (void) |
| Cleans the process list and frees memory. This will not terminate child processes. Is primarily used after fork. | |
| int | terminate_process (pid_t pid) |
| Terminates a given process. If termination does not work, the process will get killed. Terminate process can be called with the (-1 * pid) to send the signal to the process group. | |
| void | procs_terminate_childs (void) |
| This function terminates all processes spawned with create_process. Calls terminate_child for each process active. In case init_procs was not called this function does nothing. | |
| static void | init_child_signal_handlers (void) |
| static void | pre_fn_call (struct ipc_context *ctx, void *args) |
| static void | post_fn_call (struct ipc_context *ctx, void *args) |
| static void | reuse_or_add_context (struct ipc_context *ctx) |
| pid_t | create_ipc_process (ipc_process_func func, void *args) |
| initializes a communication channels and calls a function with a new process | |
| const struct ipc_contexts * | procs_get_ipc_contexts (void) |
| returns ipc_contexts. | |
Variables | |
| static struct ipc_contexts * | ipcc = NULL |
Creates new threads.
Definition in file processes.c.
| #define G_LOG_DOMAIN "sd main" |
GLib log domain.
Definition at line 35 of file processes.c.
|
static |
Cleans the process list and frees memory. This will not terminate child processes. Is primarily used after fork.
Definition at line 79 of file processes.c.
References ipc_destroy_contexts(), and ipcc.
Referenced by pre_fn_call().


| pid_t create_ipc_process | ( | ipc_process_func | func, |
| void * | args ) |
initializes a communication channels and calls a function with a new process
| func | Function to call |
| args | arguments |
Definition at line 195 of file processes.c.
References FORKFAILED, free(), ipc_exec_context::func, ipc_exec_context::func_arg, ipc_contexts_init(), ipc_exec_as_process(), IPC_PIPE, ipcc, ipc_context::pid, post_fn_call(), ipc_exec_context::post_func, pre_fn_call(), ipc_exec_context::pre_func, procs_cleanup_children(), and reuse_or_add_context().
Referenced by attack_network().


|
static |
Definition at line 126 of file processes.c.
References make_em_die(), openvas_signal, and sighand_segv().
Referenced by pre_fn_call().


|
static |
Definition at line 157 of file processes.c.
Referenced by create_ipc_process().

|
static |
Definition at line 138 of file processes.c.
References clean_procs(), init_child_signal_handlers(), init_sentry(), ipc_contexts_init(), ipc_destroy_contexts(), and ipcc.
Referenced by create_ipc_process().


| int procs_cleanup_children | ( | void | ) |
iterates through ipcc and verify if a child is stopped or killed to free the file handler.
Definition at line 47 of file processes.c.
References ipc_close(), ipcc, and pid.
Referenced by create_ipc_process(), and pluginlaunch_wait_for_free_process().


| const struct ipc_contexts * procs_get_ipc_contexts | ( | void | ) |
returns ipc_contexts.
Definition at line 239 of file processes.c.
References ipcc.
Referenced by launch_plugin().

| void procs_terminate_childs | ( | void | ) |
This function terminates all processes spawned with create_process. Calls terminate_child for each process active. In case init_procs was not called this function does nothing.
Definition at line 113 of file processes.c.
References ipcc, and terminate_process().
Referenced by handle_termination_signal().


|
static |
Definition at line 166 of file processes.c.
References ipc_context::context, ipc_add_context(), ipcc, ipc_context::pid, ipc_context::relation, and ipc_context::type.
Referenced by create_ipc_process().


| int terminate_process | ( | pid_t | pid | ) |
Terminates a given process. If termination does not work, the process will get killed. Terminate process can be called with the (-1 * pid) to send the signal to the process group.
| pid | id of the child process |
Definition at line 96 of file processes.c.
References pid.
Referenced by pluginlaunch_stop(), procs_terminate_childs(), and update_running_processes().

|
static |
Definition at line 39 of file processes.c.
Referenced by attack_start(), clean_procs(), create_ipc_process(), nasl_thread(), pre_fn_call(), procs_cleanup_children(), procs_get_ipc_contexts(), procs_terminate_childs(), and reuse_or_add_context().