32 #include <sys/ioctl.h> 35 #include <openvas/misc/network.h> 36 #include <openvas/misc/prefs.h> 55 struct arglist *l1, *l2;
57 struct arglist *l2_start = l2;
62 while (l1->next != NULL)
65 while (l2->next != NULL)
67 if (strcmp (l1->name, l2->name) == 0)
90 ret = g_malloc0 (
sizeof (
struct arglist));
92 while ((t = strchr (
list,
',')) != NULL)
95 while (
list[0] ==
' ')
99 arg_add_value (ret,
list, ARG_INT, (
void *) 1);
104 while (
list[0] ==
' ')
108 arg_add_value (ret,
list, ARG_INT, (
void *) 1);
123 if (prefs_get (
"max_hosts"))
125 max_hosts = atoi (prefs_get (
"max_hosts"));
128 log_write (
"Error ! max_hosts = %d -- check %s", max_hosts,
129 (
char *) prefs_get (
"config_file"));
134 log_write (
"Client tried to raise the maximum hosts number - %d." 135 " Using %d. Change 'max_hosts' in openvassd.conf if you" 153 if (prefs_get (
"max_checks"))
155 max_checks = atoi (prefs_get (
"max_checks"));
158 log_write (
"Error ! max_hosts = %d -- check %s", max_checks,
159 (
char *) prefs_get (
"config_file"));
164 log_write (
"Client tried to raise the maximum checks number - %d." 165 " Using %d. Change 'max_checks' in openvassd.conf if you" 186 for (i = 0, ret = 1; (i < 10) && (ret > 0); i++)
187 ret = waitpid (pid, NULL, WNOHANG);
189 return kill (pid, 0) == 0;
197 ioctl (soc, FIONREAD, &data);
208 e = waitpid (-1, NULL, WNOHANG);
211 while ((e > 0 || errno == EINTR) && n < 20);
225 if (!strcmp (pref,
"logfile") || !strcmp (pref,
"config_file")
226 || !strcmp (pref,
"plugins_folder")
227 || !strcmp (pref,
"kb_location")
228 || !strcmp (pref,
"dumpfile")
229 || !strcmp (pref,
"negot_timeout")
230 || !strcmp (pref,
"force_pubkey_auth")
231 || !strcmp (pref,
"log_whole_attack")
232 || !strcmp (pref,
"be_nice")
233 || !strcmp (pref,
"log_plugins_name_at_load")
234 || !strcmp (pref,
"nasl_no_signature_check")
236 || !strncmp (pref,
"sys_", 4))
245 auth_send (
int soc,
char *data)
247 unsigned int sent = 0;
254 data = g_convert (data, -1,
"UTF-8",
"ISO_8859-1", NULL, &length, NULL);
255 while (sent < length)
257 int n = nsend (soc, data + sent, length - sent, 0);
260 if ((errno != ENOMEM) && (errno != ENOBUFS))
281 va_start (param, data);
282 buffer = g_strdup_vprintf (data, param);
285 auth_send (soc, buffer);
int process_alive(pid_t pid)
void log_write(const char *str,...)
Write into the logfile / syslog.
void send_printf(int soc, char *data,...)
Writes data to a socket.
int is_scanner_only_pref(const char *pref)
int get_max_hosts_number(void)
int common(struct arglist *l1, struct arglist *l2)
Returns 1 if the two arglists have a name in common.
struct arglist * list2arglist(char *list)
void wait_for_children1(void)
int get_max_checks_number(void)