26 #include "../misc/scanneraux.h"
29 #include <gvm/base/prefs.h>
32 #include <sys/ioctl.h>
42 #define G_LOG_DOMAIN "sd main"
64 trans = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
68 g_hash_table_insert (trans, g_strdup (file_hash), contents);
88 gchar *filesize_str = g_strdup_printf (
"%ld", filesize);
93 trans = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
97 g_hash_table_insert (trans, g_strdup (file_hash), g_strdup (filesize_str));
111 const char *file_hash)
114 gchar *contents = NULL;
118 if (!file_hash && *file_hash ==
'\0')
121 origname = g_strdup (file_hash);
123 contents = (gchar *) g_base64_decode (file, &bytes);
125 if (contents == NULL)
127 g_debug (
"store_file: Failed to allocate memory for uploaded file.");
146 if (prefs_get (
"max_hosts"))
148 max_hosts = atoi (prefs_get (
"max_hosts"));
151 g_debug (
"Error ! max_hosts = %d -- check %s", max_hosts,
152 (
char *) prefs_get (
"config_file"));
157 g_debug (
"Client tried to raise the maximum hosts number - %d."
158 " Using %d. Change 'max_hosts' in openvas.conf if you"
159 " believe this is incorrect",
177 if (prefs_get (
"max_checks"))
179 max_checks = atoi (prefs_get (
"max_checks"));
182 g_debug (
"Error ! max_hosts = %d -- check %s", max_checks,
183 (
char *) prefs_get (
"config_file"));
188 g_debug (
"Client tried to raise the maximum checks number - %d."
189 " Using %d. Change 'max_checks' in openvas.conf if you"
190 " believe this is incorrect",
210 for (i = 0, ret = 1; (i < 10) && (ret > 0); i++)
211 ret = waitpid (
pid, NULL, WNOHANG);
213 return kill (
pid, 0) == 0;
219 ioctl (soc, FIONREAD, &data);
230 e = waitpid (-1, NULL, WNOHANG);
233 while ((e > 0 || errno == EINTR) && n < 20);
247 if (!strcmp (pref,
"logfile") || !strcmp (pref,
"config_file")
248 || !strcmp (pref,
"plugins_folder")
252 || !strcmp (pref,
"db_address") || !strcmp (pref,
"negot_timeout")
253 || !strcmp (pref,
"force_pubkey_auth")
254 || !strcmp (pref,
"log_whole_attack")
255 || !strcmp (pref,
"log_plugins_name_at_load")
256 || !strcmp (pref,
"nasl_no_signature_check")
257 || !strcmp (pref,
"vendor_version")
259 || !strncmp (pref,
"sys_", 4))