* mikhail@nessus.org <mikhail@nessus.org> [20050430 11:07]:
> Update of /usr/local/cvs/nessus-core/nessusd
>
> Modified Files:
> utils.c
> Log Message:
> Paranoia in wait_for_children1: clear errno before calling waitpid.
> This might be the cause of an infinite loop I got.
>
> Index: utils.c
> ===================================================================
> RCS file: /usr/local/cvs/nessus-core/nessusd/utils.c,v
> retrieving revision 1.117
> retrieving revision 1.118
> diff -u -d -r1.117 -r1.118
> --- utils.c 23 Mar 2005 19:22:30 -0000 1.117
> +++ utils.c 30 Apr 2005 09:07:37 -0000 1.118
> @@ -500,7 +500,9 @@
> void wait_for_children1()
> {
> int e;
> - do {
> - e = waitpid(-1, NULL, WNOHANG);
> - } while ( e > 0 || errno == EINTR );
> + do
> + {
> + errno = 0;
> + e = waitpid(-1, NULL, WNOHANG);
> + } while ( e > 0 || errno == EINTR );
> }
This doesn't help on our server with bug #1199, I still get 100%
CPU after completing the scan.
Thomas
--
Email: thomas@intevation.de
http://intevation.de/~thomas/
> Update of /usr/local/cvs/nessus-core/nessusd
>
> Modified Files:
> utils.c
> Log Message:
> Paranoia in wait_for_children1: clear errno before calling waitpid.
> This might be the cause of an infinite loop I got.
>
> Index: utils.c
> ===================================================================
> RCS file: /usr/local/cvs/nessus-core/nessusd/utils.c,v
> retrieving revision 1.117
> retrieving revision 1.118
> diff -u -d -r1.117 -r1.118
> --- utils.c 23 Mar 2005 19:22:30 -0000 1.117
> +++ utils.c 30 Apr 2005 09:07:37 -0000 1.118
> @@ -500,7 +500,9 @@
> void wait_for_children1()
> {
> int e;
> - do {
> - e = waitpid(-1, NULL, WNOHANG);
> - } while ( e > 0 || errno == EINTR );
> + do
> + {
> + errno = 0;
> + e = waitpid(-1, NULL, WNOHANG);
> + } while ( e > 0 || errno == EINTR );
> }
This doesn't help on our server with bug #1199, I still get 100%
CPU after completing the scan.
Thomas
--
Email: thomas@intevation.de
http://intevation.de/~thomas/