Subject: missing argument causes SIGCONT to not work (#429)
Index:	sys/kern_sig.c 2.11BSD

Description:
	When the cshell issues a "killpg(pid, SIGCONT)" to
	background a setuid process the call fails leaving the
	process in a STOP'd state.

Repeat-By:
	Start a setuid program, hit ^Z and then 'bg'.  Csh thinks
	it has backgrounded the process (because it does not check
	the success/failure status of killpg(2)) but in reality the
	process is still in a 'T' (STOP) state.

Fix:
	Sigh - I really should run lint(1) over the kernel.  Either
	that or learn to count arguments in function calls (it'd be
	nice if the compiler would do that but so far no one has
	come up with a better compiler).

	The problem was caused by a missing argument to 'cansignal'.

	With the signal number passed into 'cansignal' SIGCONT works
	correctly.

	Save to a file, cut where indicated  and then:

		patch -p0 < /tmp/429

	You'll need to recompile the current kernel - with _luck_ the
	.o files from the previous compiles (done in 426 thru 428) will
	still be around thereby saving quite a bit of time.

	As always this and previous updates to 2.11BSD are available via
	anonymous FTP to either FTP.GD-ISO.COM or MOE.2BSD.COM in the
	directory /pub/2.11BSD.

-------------------------cut here------------------------
*** /usr/src/sys/sys/kern_sig.c.old	Thu Sep  9 21:15:29 1999
--- /usr/src/sys/sys/kern_sig.c	Fri Sep 24 21:03:12 1999
***************
*** 3,9 ****
   * All rights reserved.  The Berkeley software License Agreement
   * specifies the terms and conditions for redistribution.
   *
!  *	@(#)kern_sig.c	1.11 (2.11BSD) 1999/9/9
   */
  
  #include "param.h"
--- 3,9 ----
   * All rights reserved.  The Berkeley software License Agreement
   * specifies the terms and conditions for redistribution.
   *
!  *	@(#)kern_sig.c	1.12 (2.11BSD) 1999/9/24
   */
  
  #include "param.h"
***************
*** 34,40 ****
   * 1) either the real or effective user ids match OR 2) if the signal is 
   * SIGCONT and the target process is a descendant of the current process
  */
! cansignal(q,signum)
  	register struct proc *q;
  	int	signum;
  	{
--- 34,40 ----
   * 1) either the real or effective user ids match OR 2) if the signal is 
   * SIGCONT and the target process is a descendant of the current process
  */
! cansignal(q, signum)
  	register struct proc *q;
  	int	signum;
  	{
***************
*** 230,236 ****
  			error = ESRCH;
  			goto out;
  		}
! 		if (!cansignal(p))
  			error = EPERM;
  		else if (uap->signo)
  			psignal(p, uap->signo);
--- 230,236 ----
  			error = ESRCH;
  			goto out;
  		}
! 		if (!cansignal(p, uap->signo))
  			error = EPERM;
  		else if (uap->signo)
  			psignal(p, uap->signo);
***************
*** 286,292 ****
  		if ((p->p_pgrp != pgrp && !all) || p->p_ppid == 0 ||
  		    (p->p_flag&SSYS) || (all && p == u.u_procp))
  			continue;
! 		if (!cansignal(p)) {
  			if (!all)
  				error = EPERM;
  			continue;
--- 286,292 ----
  		if ((p->p_pgrp != pgrp && !all) || p->p_ppid == 0 ||
  		    (p->p_flag&SSYS) || (all && p == u.u_procp))
  			continue;
! 		if (!cansignal(p, signo)) {
  			if (!all)
  				error = EPERM;
  			continue;
*** /VERSION.old	Fri Sep 24 20:30:26 1999
--- /VERSION	Fri Sep 24 21:20:40 1999
***************
*** 1,4 ****
! Current Patch Level: 428
  Date: September 24, 1999
  
  2.11 BSD
--- 1,4 ----
! Current Patch Level: 429
  Date: September 24, 1999
  
  2.11 BSD
