yppush_main.c yppush_exit() recursion prevention

Thomas Quinot <[email protected]> Fri, 1 Apr 2005 16:35:39 +0200
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I intend to commit the following to HEAD in the forthcoming days,
unless there is an objection to this change.

When exitting upon an abnormal signal, yppush_exit() should not
attempt to clear its pending jobs list, as this could trigger another
signal, and cause an infinite recursion. What yppush_exit() tests
in order to determine whether to flush pending jobs is the
yppush_joblist chained list, so this is what needs to be cleared
in that case (not the yppush_jobs counter).

Index: yppush_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/usr.sbin/yppush/yppush_main.c,v
retrieving revision 1.19
diff -u -r1.19 yppush_main.c
--- yppush_main.c	17 Oct 2004 19:33:33 -0000	1.19
+++ yppush_main.c	24 Dec 2004 15:38:59 -0000
@@ -208,7 +208,7 @@
 handler(int sig)
 {
 	if (sig =3D=3D SIGTERM || sig =3D=3D SIGINT || sig =3D=3D SIGABRT) {
-		yppush_jobs =3D 0;
+		yppush_joblist =3D NULL;
 		yppush_exit(1);
 	}
=20
Thomas.


--yrj/dFKFPuw6o+aM
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iD8DBQFCTVw6AE1UuDk9JGkRAmHuAJ4wNnQxlJZ0bXjEd8QKhE9nqedUqgCcDMk7
YGzbL42LcB36zZmcskUO138=
=dygv
-----END PGP SIGNATURE-----

--yrj/dFKFPuw6o+aM--