Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2013 06:01:35 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245961 - head/usr.sbin/newsyslog
Message-ID:  <201301270601.r0R61ZiJ012624@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sun Jan 27 06:01:35 2013
New Revision: 245961
URL: http://svnweb.freebsd.org/changeset/base/245961

Log:
  When the 'R' flag is used with a newsyslog.conf entry, some fields of
  the corresponding struct sigwork_entry were left uninitialized,
  potentially causing an early return from do_sigwork(). Ensure that these
  fields are initialized, and handle the 'R' flag properly in
  do_sigwork().
  
  PR:		bin/175330
  Reviewed by:	gad
  Approved by:	rstone (co-mentor)
  MFC after:	1 week

Modified:
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/usr.sbin/newsyslog/newsyslog.c
==============================================================================
--- head/usr.sbin/newsyslog/newsyslog.c	Sun Jan 27 05:59:28 2013	(r245960)
+++ head/usr.sbin/newsyslog/newsyslog.c	Sun Jan 27 06:01:35 2013	(r245961)
@@ -1866,7 +1866,7 @@ do_sigwork(struct sigwork_entry *swork)
 	int kres, secs;
 	char *tmp;
 
-	if (!(swork->sw_pidok) || swork->sw_pid == 0)
+	if (swork->run_cmd == 0 && (!(swork->sw_pidok) || swork->sw_pid == 0))
 		return;			/* no work to do... */
 
 	/*
@@ -2078,6 +2078,8 @@ save_sigwork(const struct conf_entry *en
 	stmp->run_cmd = 0;
 	/* If this is a command to run we just set the flag and run command */
 	if (ent->flags & CE_PID2CMD) {
+		stmp->sw_pid = -1;
+		stmp->sw_pidok = 0;
 		stmp->run_cmd = 1;
 	} else {
 		set_swpid(stmp, ent);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301270601.r0R61ZiJ012624>