remote processes started with rsh can be killed unintentionally

Mark Plotnick mp at allegra.UUCP
Tue Jul 30 06:34:15 AEST 1985


...
Description:
	rsh will catch interrupt, quit, and soft kill signals, and propagate
	them to the remote process, even if those signals were being
	ignored, for example by having started the rsh in the background
	or with nohup.
	This is only a problem for /bin/sh users, since it doesn't
	place children in different process groups as the csh does.
Repeat-By:
	$ rsh presto "troff big-job" &
	$ [ at this point if you type ^C, the troff will be interrupted ]
Fix:
	
*** /tmp/rsh.c.old
--- /tmp/rsh.c
***************
*** 127,135
  	}
  	(void) setuid(getuid());
  	omask = sigblock(mask(SIGINT)|mask(SIGQUIT)|mask(SIGTERM));
! 	signal(SIGINT, sendsig);
! 	signal(SIGQUIT, sendsig);
! 	signal(SIGTERM, sendsig);
          pid = fork();
          if (pid < 0) {
  		perror("fork");

--- 127,138 -----
  	}
  	(void) setuid(getuid());
  	omask = sigblock(mask(SIGINT)|mask(SIGQUIT)|mask(SIGTERM));
! 	if(signal(SIGINT,SIG_IGN)!=SIG_IGN)
! 		signal(SIGINT, sendsig);
! 	if(signal(SIGQUIT,SIG_IGN)!=SIG_IGN)
! 		signal(SIGQUIT, sendsig);
! 	if(signal(SIGTERM,SIG_IGN)!=SIG_IGN)
! 		signal(SIGTERM, sendsig);
          pid = fork();
          if (pid < 0) {
  		perror("fork");


	Mark Plotnick
	allegra!mp



More information about the Comp.bugs.4bsd.ucb-fixes mailing list