OpenVAS Scanner 23.40.3
sighand.h File Reference

headerfile for sighand.c. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sighand_chld (int sig)
void sighand_segv (int sig)
void let_em_die (int pid)
void make_em_die (int sig)

Variables

void(*)(int) openvas_signal (int signum, void(*handler)(int))

Detailed Description

headerfile for sighand.c.

Definition in file sighand.h.

Function Documentation

◆ let_em_die()

void let_em_die ( int pid)

Definition at line 32 of file sighand.c.

33{
34 int status;
35
36 waitpid (pid, &status, WNOHANG);
37}
static pid_t pid

References pid.

Referenced by make_em_die().

Here is the caller graph for this function:

◆ make_em_die()

void make_em_die ( int sig)

Definition at line 40 of file sighand.c.

41{
42 /* number of times, the sig is sent at most */
43 int n = 3;
44
45 /* leave if we are session leader */
46 if (getpgrp () != getpid ())
47 return;
48
49 /* quickly send signals and check the result */
50 if (kill (0, sig) < 0)
51 return;
52 let_em_die (0);
53 if (kill (0, 0) < 0)
54 return;
55
56 do
57 {
58 /* send the signal to everybody in the group */
59 if (kill (0, sig) < 0)
60 return;
61 sleep (1);
62 /* do not leave a zombie, hanging around if possible */
63 let_em_die (0);
64 }
65 while (--n > 0);
66
67 if (kill (0, 0) < 0)
68 return;
69
70 kill (0, SIGKILL);
71 sleep (1);
72 let_em_die (0);
73}
void let_em_die(int pid)
Definition sighand.c:32

References let_em_die().

Referenced by init_child_signal_handlers(), and sighand_segv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sighand_chld()

void sighand_chld ( int sig)

Definition at line 95 of file sighand.c.

96{
97 (void) sig;
98 // if we call multiple times waitpid it will disturb the attack loop.
99 // therefore we cannot cleanup multiple ipc here
100 waitpid (-1, NULL, WNOHANG);
101}

Referenced by init_signal_handlers().

Here is the caller graph for this function:

◆ sighand_segv()

void sighand_segv ( int sig)

Definition at line 123 of file sighand.c.

124{
125 print_trace ();
126 make_em_die (SIGTERM);
127 gvm_close_sentry ();
128 /* Raise signal again, to exit with the correct return value,
129 * and to enable core dumping. */
130 openvas_signal (given_signal, SIG_DFL);
131 raise (given_signal);
132}
void(*)(int) openvas_signal(int signum, void(*handler)(int))
Definition sighand.c:79
static void print_trace(void)
Definition sighand.c:104
void make_em_die(int sig)
Definition sighand.c:40

References make_em_die(), openvas_signal, and print_trace().

Referenced by init_child_signal_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ openvas_signal

void(*)(int) openvas_signal(int signum, void(*handler)(int)) ( int signum,
void(* handler )(int) )

Definition at line 16 of file sighand.h.