Mailing List Archive

nessus-core/nessusd attack.c, 1.211, 1.212 auth.c, 1.33, 1.34 comm.c, 1.78, 1.79 detached.c, 1.37, 1.38 dirutils.c, 1.7, 1.8 hosts.c, 1.26, 1.27 locks.c, 1.11, 1.12 log.c, 1.32, 1.33 md5.c, 1.10, 1.11 nasl_plugins.c, 1.74, 1.75 nes_plugins.c, 1.69, 1.70 n
Update of /usr/local/cvs/nessus-core/nessusd
In directory raccoon.nessus.org:/tmp/cvs-serv4246/nessus-core/nessusd

Modified Files:
attack.c auth.c comm.c detached.c dirutils.c hosts.c locks.c
log.c md5.c nasl_plugins.c nes_plugins.c
nessus-check-signature.c nessusd.c ntp_10.c ntp_11.c parser.c
piic.c pluginlaunch.c pluginload.c pluginscheduler.c
pluginscheduler.h pluginupload.c plugs_hash.c plugs_req.c
preferences.c processes.c rules.c save_kb.c save_tests.c
shared_socket.c sighand.c users.c utils.c
Log Message:
Synchronize back DEVEL with 2.2

Index: attack.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/attack.c,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -d -r1.211 -r1.212
--- attack.c 5 Jul 2005 15:59:42 -0000 1.211
+++ attack.c 12 Sep 2006 09:49:06 -0000 1.212
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -546,10 +546,11 @@
int fork_retries = 0;
harglst * files;
hargwalk * hw;
- char * key;
+ char * key;
struct timeval then, now;
-
+
gettimeofday(&then, NULL);
+
host_ip.s_addr = 0;
preferences = arg_get_value(globals, "preferences");
detached = preferences_detached_scan(preferences);

Index: auth.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/auth.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- auth.c 27 Oct 2004 13:00:37 -0000 1.33
+++ auth.c 12 Sep 2006 09:49:06 -0000 1.34
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: comm.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/comm.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- comm.c 19 Jan 2005 21:23:29 -0000 1.78
+++ comm.c 12 Sep 2006 09:49:07 -0000 1.79
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -387,21 +387,24 @@
comm_send_rules(globals)
struct arglist * globals;
{
- struct nessus_rules * rules = arg_get_value(globals, "rules");
-
+
auth_printf(globals, "SERVER <|> RULES <|>\n");
+#ifdef USELESS_AS_OF_NOW
+ struct nessus_rules * rules = arg_get_value(globals, "rules");
while(rules && rules->next)
{
+ char c = 0;
if(rules->rule == RULES_ACCEPT)
- auth_printf(globals, "accept %s%s/%d\n", rules->not?"!":"",
+ auth_printf(globals, "accept %c%s/%d\n", rules->not?'!':'',
inet_ntoa(rules->ip),
rules->mask);
else
- auth_printf(globals, "reject %s%s/%d\n", rules->not?"!":"",
+ auth_printf(globals, "reject %c%s/%d\n", rules->not?'!':'',
inet_ntoa(rules->ip),
rules->mask);
rules = rules->next;
}
+#endif
auth_printf(globals, "<|> SERVER\n");
}


Index: detached.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/detached.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- detached.c 27 Oct 2004 13:00:37 -0000 1.37
+++ detached.c 12 Sep 2006 09:49:07 -0000 1.38
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: dirutils.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/dirutils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- dirutils.c 27 Oct 2004 13:00:38 -0000 1.7
+++ dirutils.c 12 Sep 2006 09:49:07 -0000 1.8
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: hosts.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/hosts.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- hosts.c 10 Dec 2004 19:12:30 -0000 1.26
+++ hosts.c 12 Sep 2006 09:49:07 -0000 1.27
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: locks.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/locks.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- locks.c 27 Oct 2004 13:00:38 -0000 1.11
+++ locks.c 12 Sep 2006 09:49:07 -0000 1.12
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: log.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/log.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- log.c 12 Jul 2005 19:53:47 -0000 1.32
+++ log.c 12 Sep 2006 09:49:07 -0000 1.33
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -23,8 +23,6 @@

#include <includes.h>
#include <stdarg.h>
-#include <syslog.h>
-
#include "comm.h"
#include "utils.h"
#include "log.h"
@@ -77,10 +75,6 @@
log = stderr;
dup2(2, 3);
}
- else if(!strcmp(filename, "syslog")){
- openlog("nessusd", 0, LOG_DAEMON);
- log = NULL;
- }
else
{
int fd = open(filename, O_WRONLY|O_CREAT|O_APPEND
@@ -128,7 +122,6 @@
fclose(log);
log = NULL;
}
- else closelog();
}


@@ -165,6 +158,5 @@
timestr[strlen(timestr) - 1 ] = '\0';
fprintf(log, "[%s][%d] %s\n", timestr, getpid(), disp);
}
- else syslog(LOG_NOTICE, "%s", disp);
}


Index: md5.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/md5.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- md5.c 7 Jul 2005 00:19:59 -0000 1.10
+++ md5.c 12 Sep 2006 09:49:07 -0000 1.11
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

Index: nasl_plugins.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/nasl_plugins.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- nasl_plugins.c 21 Jan 2005 14:25:28 -0000 1.74
+++ nasl_plugins.c 12 Sep 2006 09:49:07 -0000 1.75
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1999 - 2003 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -38,6 +38,7 @@

static void nasl_thread(struct arglist *);

+
/*
* Add *one* .nasl plugin to the plugin list
*/
@@ -82,12 +83,22 @@
}
plug_set_path(plugin_args, fullname);
if(plug_get_id(plugin_args) > 0)
- plugin_args = store_plugin(plugin_args, name);
+ {
+ store_plugin(plugin_args, name);
+ plugin_args = store_load_plugin(folder, name, preferences);
+ }
+
}

+ if ( plugin_args == NULL )
+ {
+ /* Discard invalid plugins */
+ fprintf(stderr, "%s failed to load\n", name);
+ return NULL;
+ }
+
if(plug_get_id(plugin_args) == 0)
{
- /* Discard invalid plugins */
plugin_free(plugin_args);
return NULL;
}
@@ -182,35 +193,35 @@
{
close(i);
}
-#ifdef RLIMIT_RSS
- {
- struct rlimit rlim;
- getrlimit(RLIMIT_RSS, &rlim);
- rlim.rlim_cur = 1024*1024*40;
- rlim.rlim_max = 1024*1024*40;
- setrlimit(RLIMIT_RSS, &rlim);
- }
-#endif
-
-#ifdef RLIMIT_AS
- {
- struct rlimit rlim;
- getrlimit(RLIMIT_AS, &rlim);
- rlim.rlim_cur = 1024*1024*40;
- rlim.rlim_max = 1024*1024*40;
- setrlimit(RLIMIT_AS, &rlim);
- }
-#endif
-
-#ifdef RLIMIT_DATA
- {
- struct rlimit rlim;
- getrlimit(RLIMIT_DATA, &rlim);
- rlim.rlim_cur = 1024*1024*40;
- rlim.rlim_max = 1024*1024*40;
- setrlimit(RLIMIT_DATA, &rlim);
- }
-#endif
+ #ifdef RLIMIT_RSS
+ {
+ struct rlimit rlim;
+ getrlimit(RLIMIT_RSS, &rlim);
+ rlim.rlim_cur = 1024*1024*512;
+ rlim.rlim_max = 1024*1024*512;
+ setrlimit(RLIMIT_RSS, &rlim);
+ }
+ #endif
+
+ #ifdef RLIMIT_AS
+ {
+ struct rlimit rlim;
+ getrlimit(RLIMIT_AS, &rlim);
+ rlim.rlim_cur = 1024*1024*512;
+ rlim.rlim_max = 1024*1024*512;
+ setrlimit(RLIMIT_AS, &rlim);
+ }
+ #endif
+
+ #ifdef RLIMIT_DATA
+ {
+ struct rlimit rlim;
+ getrlimit(RLIMIT_DATA, &rlim);
+ rlim.rlim_cur = 1024*1024*512;
+ rlim.rlim_max = 1024*1024*512;
+ setrlimit(RLIMIT_DATA, &rlim);
+ }
+ #endif
setproctitle("testing %s (%s)", (char*)arg_get_value(arg_get_value(args, "HOSTNAME"), "NAME"), (char*)arg_get_value(g_args, "name"));
signal(SIGTERM, _exit);


Index: nes_plugins.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/nes_plugins.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- nes_plugins.c 19 Jan 2005 21:23:29 -0000 1.69
+++ nes_plugins.c 12 Sep 2006 09:49:07 -0000 1.70
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1999 - 2003 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -164,7 +164,8 @@
if(e >= 0)
{
plug_set_path(args, fullname);
- args = store_plugin(args, name);
+ store_plugin(args, name);
+ args = store_load_plugin(folder, name, preferences);
}
else
{
@@ -211,7 +212,10 @@

ptr = LOAD_LIBRARY(name);
if( ptr == NULL)
+ {
+ log_write("Couldn't load %s - %s\n", name, LIB_LAST_ERROR());
return -1;
+ }


func = (plugin_run_t)LOAD_FUNCTION(ptr, "plugin_run");
@@ -261,39 +265,7 @@
{
close(i);
}
-

-#ifdef RLIMIT_RSS
- {
- struct rlimit rlim;
- getrlimit(RLIMIT_RSS, &rlim);
- rlim.rlim_cur = 1024*1024*40;
- rlim.rlim_max = 1024*1024*40;
- setrlimit(RLIMIT_RSS, &rlim);
- }
-#endif
-
-#ifdef RLIMIT_AS
- {
- struct rlimit rlim;
- getrlimit(RLIMIT_AS, &rlim);
- rlim.rlim_cur = 1024*1024*40;
- rlim.rlim_max = 1024*1024*40;
- setrlimit(RLIMIT_AS, &rlim);
- }
-#endif
-
-#ifdef RLIMIT_DATA
- {
- struct rlimit rlim;
- getrlimit(RLIMIT_DATA, &rlim);
- rlim.rlim_cur = 1024*1024*40;
- rlim.rlim_max = 1024*1024*40;
- setrlimit(RLIMIT_DATA, &rlim);
- }
-#endif
-
-
setproctitle("testing %s (%s)", (char*)arg_get_value(arg_get_value(args, "HOSTNAME"), "NAME"), (char*)arg_get_value(args, "name"));
func = arg_get_value(args, "func");
signal(SIGTERM, _exit);

Index: nessus-check-signature.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/nessus-check-signature.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- nessus-check-signature.c 7 Jul 2005 00:19:59 -0000 1.3
+++ nessus-check-signature.c 12 Sep 2006 09:49:08 -0000 1.4
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: nessusd.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/nessusd.c,v
retrieving revision 1.242
retrieving revision 1.243
diff -u -d -r1.242 -r1.243
--- nessusd.c 5 Jul 2005 18:21:18 -0000 1.242
+++ nessusd.c 12 Sep 2006 09:49:08 -0000 1.243
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -946,7 +946,7 @@
chmod(name, 0777);
#endif

- if(listen(*sock, 128)==-1)
+ if(listen(*sock, 10)==-1)
{
fprintf(stderr, "listen() failed : %s\n", strerror(errno));
shutdown(*sock, 2);
@@ -1219,7 +1219,7 @@
break;

case 'v' :
- print_error("nessusd (%s) %s for %s\n(C) 1998 - 2004 Renaud Deraison <deraison@nessus.org>\n\n",
+ print_error("nessusd (%s) %s for %s\n(C) 1998 - 2006 Tenable Network Security, Inc.\n\n",
PROGNAME,NESSUS_VERSION, NESS_OS_NAME);
DO_EXIT(0);
break;

Index: ntp_10.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/ntp_10.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ntp_10.c 27 Oct 2004 13:00:38 -0000 1.8
+++ ntp_10.c 12 Sep 2006 09:49:08 -0000 1.9
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: ntp_11.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/ntp_11.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- ntp_11.c 6 Dec 2004 14:29:14 -0000 1.76
+++ ntp_11.c 12 Sep 2006 09:49:08 -0000 1.77
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -285,12 +285,12 @@
struct arglist * preferences = arg_get_value(globals, "preferences");
int soc = (int)arg_get_value(globals, "global_socket");
char * input;
- int input_sz = 65535;
+ int input_sz = 1024*1024;
int n;

input = emalloc(input_sz);
for (;;) {
- bzero(input, input_sz);
+ input[0] = '\0';
#if defined NESSUS_ON_SSL && DEBUG_SSL > 2
fprintf(stderr, "ntp_11_read_prefs > soc=%d\n", soc);
#endif
@@ -390,14 +390,6 @@
char * buffer;
int finished = 0;
struct sockaddr_in * soca;
-
- if(arg_get_type(globals, "saved_rules")<0)
- arg_add_value(globals, "saved_rules", ARG_PTR, -1, rules_dup(rules));
- else
- {
- rules_free(rules);
- rules = rules_dup(arg_get_value(globals, "saved_rules"));
- }

buffer = emalloc(4096);
while(!finished)
@@ -983,13 +975,18 @@
if(strlen(fname) + strlen(buf) + 6 > buf_size)
{
buf_size *= 2;
+ if(strlen(fname) + strlen(buf) + 6 > buf_size)
+ buf_size = strlen(fname) + strlen(buf) + 6;
+
buf = erealloc(buf, buf_size);
}
strncat(buf, fname, buf_size);
strncat(buf, " <|> ", buf_size);
deps = deps->next;
}
+#if 0
arg_free_all(d);
+#endif

auth_printf(globals, "%s\n", buf);


Index: parser.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/parser.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- parser.c 27 Oct 2004 13:00:39 -0000 1.6
+++ parser.c 12 Sep 2006 09:49:08 -0000 1.7
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: piic.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/piic.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- piic.c 27 Oct 2004 13:00:39 -0000 1.44
+++ piic.c 12 Sep 2006 09:49:08 -0000 1.45
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: pluginlaunch.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/pluginlaunch.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- pluginlaunch.c 19 Jan 2005 21:23:29 -0000 1.101
+++ pluginlaunch.c 12 Sep 2006 09:49:08 -0000 1.102
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: pluginload.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/pluginload.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- pluginload.c 19 Nov 2004 09:06:24 -0000 1.47
+++ pluginload.c 12 Sep 2006 09:49:08 -0000 1.48
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: pluginscheduler.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/pluginscheduler.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- pluginscheduler.c 16 Jun 2005 19:11:28 -0000 1.33
+++ pluginscheduler.c 12 Sep 2006 09:49:08 -0000 1.34
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -275,7 +275,9 @@
l->num_deps ++;
al = al->next;
}
+#if 0
arg_free_all(deps);
+#endif
}

if( ports == NULL )
@@ -658,7 +660,9 @@
struct list * l = ret->list[i];
while (l != NULL )
{
- if(plug_get_launch(l->plugin->arglist->value) == LAUNCH_DISABLED)
+ if(plug_get_launch(l->plugin->arglist->value) == LAUNCH_DISABLED &&
+ plug_get_category(l->plugin->arglist->value) != ACT_INIT &&
+ plug_get_category(l->plugin->arglist->value) != ACT_SETTINGS )
{
struct list * old = l->next;

@@ -700,7 +704,7 @@
l = h->list[category];

/*
- * Scanners (and DoS) must not be run in parrallel
+ * Scanners (and DoS) must not be run in parallel
*/

if((category == ACT_SCANNER) ||
@@ -800,7 +804,8 @@

/* Could not find anything */
if((category == ACT_SCANNER ||
- category == ACT_INIT) && flag != 0)
+ category == ACT_INIT ||
+ category == ACT_SETTINGS) && flag != 0)
{
pluginlaunch_wait_for_free_process();
flag = 0;

Index: pluginscheduler.h
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/pluginscheduler.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pluginscheduler.h 22 Mar 2005 11:56:09 -0000 1.9
+++ pluginscheduler.h 12 Sep 2006 09:49:08 -0000 1.10
@@ -42,7 +42,7 @@
};

struct plist {
- char name[32];
+ char name[64];
int occurences;
struct plist * next;
struct plist * prev;

Index: pluginupload.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/pluginupload.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- pluginupload.c 27 Oct 2004 13:00:39 -0000 1.19
+++ pluginupload.c 12 Sep 2006 09:49:09 -0000 1.20
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

Index: plugs_hash.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/plugs_hash.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- plugs_hash.c 27 Oct 2004 13:00:39 -0000 1.19
+++ plugs_hash.c 12 Sep 2006 09:49:09 -0000 1.20
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

Index: plugs_req.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/plugs_req.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- plugs_req.c 27 Oct 2004 13:00:39 -0000 1.21
+++ plugs_req.c 12 Sep 2006 09:49:09 -0000 1.22
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: preferences.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/preferences.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- preferences.c 19 Jan 2005 21:23:29 -0000 1.109
+++ preferences.c 12 Sep 2006 09:49:09 -0000 1.110
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -74,10 +74,10 @@
fprintf(fd, "be_nice = no\n\n");


- fprintf(fd, "# Log file (or 'syslog') : \n");
+ fprintf(fd, "# Log file : \n");
fprintf(fd, "logfile = %s\n\n", NESSUSD_MESSAGES);
- fprintf(fd, "# Shall we log every details of the attack ?\n");
- fprintf(fd, "log_whole_attack = yes\n\n");
+ fprintf(fd, "# Shall we log every details of the attack ? (disk intensive)\n");
+ fprintf(fd, "log_whole_attack = no\n\n");
fprintf(fd, "# Log the name of the plugins that are loaded by the server ?\n");
fprintf(fd, "log_plugins_name_at_load = no\n\n");
fprintf(fd, "# Dump file for debugging output, use `-' for stdout\n");
@@ -92,10 +92,10 @@
fprintf(fd, "# 'default' means that Nessus will scan ports found in its\n");
fprintf(fd, "# services file.\n");
fprintf(fd, "port_range = default\n\n");
- fprintf(fd, "# Optimize the test (recommanded) : \n");
+ fprintf(fd, "# Optimize the test (recommended) : \n");
fprintf(fd, "optimize_test = yes\n\n");
fprintf(fd, "# Language of the plugins :\n");
- fprintf(fd, "language = english\n\n");
+ fprintf(fd, "language = %s\n\n", NESSUSD_LANGUAGE);

fprintf(fd, "\n\n# Optimization : \n");
fprintf(fd, "# Read timeout for the sockets of the tests : \n");
@@ -204,12 +204,15 @@

buffer[sizeof(buffer) - 1] = '\0';
len = strlen(buffer);
+ if ( len == 0 ) continue;

if(buffer[len-1]=='\n')
{
buffer[len-1]=0;
len --;
}
+
+ if ( len <= 0 ) continue;

if(buffer[0]=='#')continue;
opt = buffer;
@@ -217,26 +220,29 @@
if( t == NULL )continue;
else {
t[0]=0;
- t+=sizeof(char);
- while(t[0]==' ')t+=sizeof(char);
+ t++;
+ while(t[0]==' ')t++;
len = strlen(opt);
- while(opt[len-1]==' ')
+ while(len > 0 && opt[len-1]==' ')
{
opt[len-1]= '\0';
len --;
}
+ if ( len <= 0 ) continue;

len = strlen(t);
- while(t[len-1]==' ')
+ while(len > 0 && t[len-1]==' ')
{
t[len-1]= '\0';
len --;
}
-
+
+ if ( len <= 0 ) continue;
+ len = strlen(t);
value = emalloc(len + 1);
strncpy(value, t, len);
arg_add_value(prefs, opt, ARG_STRING, strlen(value), value);
-#ifdef DEBUGMORE
+#if DEBUGMORE
printf("%s = %s\n", opt, value);
#endif
}

Index: processes.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/processes.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- processes.c 18 Jun 2005 22:37:50 -0000 1.10
+++ processes.c 12 Sep 2006 09:49:09 -0000 1.11
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify
@@ -94,8 +94,10 @@
nessus_signal(SIGUSR2, SIG_IGN);
nessus_signal(SIGCHLD, sighand_chld);
nessus_signal(SIGSEGV, sighand_segv); /* Comment this line out to dump a core and debug nessusd */
+
/* Desynchronize random generator from father - this should be enough */
srand48(myrand);
+
(*function)(argument);
EXIT(0);
}

Index: rules.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/rules.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- rules.c 6 Dec 2004 11:41:56 -0000 1.27
+++ rules.c 12 Sep 2006 09:49:09 -0000 1.28
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -179,19 +179,28 @@
fclose(f);
}

-
struct nessus_rules *
-rules_dup(struct nessus_rules *source)
+rules_dup_aux(s, r)
+ struct nessus_rules * s, *r;
{
- struct nessus_rules *target = NULL;
-
- if(source)
+ printf("rules_dup called - does not work\n");
+ if(!s->next)return r;
+ else
{
- target = memcpy(emalloc(sizeof(struct nessus_rules)),
- source, sizeof(struct nessus_rules));
- target->next = rules_dup(source->next);
+ r->ip.s_addr = s->ip.s_addr;
+ r->mask = s->mask;
+ r->rule = s->rule;
+ r->not = s->not;
+ r->def = s->def;
+ r->next = emalloc(sizeof(*r));
+ return rules_dup_aux(s->next,r->next);
}
- return target;
+}
+struct nessus_rules *
+rules_dup(struct nessus_rules *s)
+{
+ struct nessus_rules * r = emalloc(sizeof(*r));
+ return rules_dup_aux(s, r);
}



Index: save_kb.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/save_kb.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- save_kb.c 27 Oct 2004 13:00:40 -0000 1.55
+++ save_kb.c 12 Sep 2006 09:49:09 -0000 1.56
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: save_tests.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/save_tests.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- save_tests.c 27 Oct 2004 13:00:40 -0000 1.30
+++ save_tests.c 12 Sep 2006 09:49:09 -0000 1.31
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: shared_socket.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/shared_socket.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- shared_socket.c 7 May 2005 02:54:27 -0000 1.7
+++ shared_socket.c 12 Sep 2006 09:49:10 -0000 1.8
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: sighand.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/sighand.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- sighand.c 27 Oct 2004 13:00:40 -0000 1.42
+++ sighand.c 12 Sep 2006 09:49:10 -0000 1.43
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,

Index: users.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/users.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- users.c 15 Sep 2005 00:46:32 -0000 1.50
+++ users.c 12 Sep 2006 09:49:10 -0000 1.51
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
*
* This program is free software; you can redistribute it and/or modify

Index: utils.c
===================================================================
RCS file: /usr/local/cvs/nessus-core/nessusd/utils.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- utils.c 30 Apr 2005 09:07:37 -0000 1.118
+++ utils.c 12 Sep 2006 09:49:10 -0000 1.119
@@ -1,5 +1,5 @@
/* Nessus
- * Copyright (C) 1998 - 2004 Renaud Deraison
+ * Copyright (C) 1998 - 2006 Tenable Network Security, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -499,10 +499,10 @@

void wait_for_children1()
{
- int e;
- do
- {
- errno = 0;
- e = waitpid(-1, NULL, WNOHANG);
- } while ( e > 0 || errno == EINTR );
+ int e, n = 0;
+ do {
+ errno = 0;
+ e = waitpid(-1, NULL, WNOHANG);
+ n++;
+ } while ( (e > 0 || errno == EINTR) && n < 20 );
}

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs@list.nessus.org
http://mail.nessus.org/mailman/listinfo/nessus-cvs