diff -Naur nessus-core/nessusd-orig/nessusd.c nessus-core/nessusd/nessusd.c --- nessus-core/nessusd-orig/nessusd.c Mon Oct 1 07:15:55 2001 +++ nessus-core/nessusd/nessusd.c Thu Jan 17 12:10:36 2002 @@ -96,6 +96,15 @@ dump_cfg_specs (struct arglist *prefs) { +#if 1 + while (prefs != NULL && prefs->name != NULL) + { + printf ("%s = %s\n", prefs->name, prefs->value); + prefs = prefs->next; + } + +#else + char *t; static const char **S, *pfs [] = { "config_file", @@ -130,10 +139,12 @@ # endif 0 } ; + for (S = pfs; *S != 0; S ++) { if ((t = arg_get_value (prefs, *S)) != 0) printf ("%s = %s\n", *S, t); } +#endif } static void diff -Naur nessus-core/nessusd-orig/sighand.c nessus-core/nessusd/sighand.c --- nessus-core/nessusd-orig/sighand.c Wed Aug 22 14:54:58 2001 +++ nessus-core/nessusd/sighand.c Thu Jan 17 10:53:34 2002 @@ -73,12 +73,14 @@ return ; # endif - /* leave if we are session leader */ + /* leave if we are NOT session leader */ /* DAB */ if (getpgrp () != getpid()) return ; - /* quickly send siglals and check the result */ - if (kill (0, sig) < 0) return ; + /* quickly send signals and check the result */ + if (kill (0, sig) < 0) return; /* nope - kill failed */ /* DAB */ let_em_die (0); + + /* check if any children - return if none*/ /* DAB */ if (kill (0, 0) < 0) return ; do { @@ -133,12 +135,16 @@ { int max_iterations = 2000; int i = 0; - while(waitpid(0, NULL, WNOHANG) > 0) + int pid; + int status; + while((pid = waitpid(-1, &status, WNOHANG)) > 0) { i++; if(i > max_iterations) break; } + + if (pid < 0 && i == 0) log_write("Couldn't get child status (%s)\n", strerror(errno)); /* DAB */ } void sighand_alarm()