tip bug fix

Jack Nelson jack at cadre.dsl.PITTSBURGH.EDU
Wed May 4 05:07:08 AEST 1988


Index:	/usr/src/usr.bin/tip/cmds.c  2.10BSD

Description:
	tip(1) will not properly run a shell if the environment
	SHELL is /bin/csh or /bin/tcsh.
Repeat-By:
	Procedure to repeat the problem: try it.  Works ok if SHELL=/bin/sh
	or if .tiprc has a line "SHELL=/bin/sh", but then you get /bin/sh.
Fix:
	Description of how to fix the problem:
	patch cmds.c to use the "-b" option as documented in csh(1) to
	be necessary when you run setuid and try to fork a csh.
	The patch calls sh(1) without that flag, all other with it.  If
	you use some other shell besides csh or tcsh this will not be
	general enough.

UUCP: { akgua | allegra | cmcl2 | idis | ihnp4 | mi-cec | pitt |
	psuvax1 | sun | sunrise | vax135 } ! cadre ! nelslab ! jack
ARPA: jack at cadre.dsl.pittsburgh.edu
John P. Nelson, M.D., 3811 O'Hara St, Pittsburgh, PA 15213, t:412-624-1769
Dept. of Psychiatry, U. of Pittsburgh

Cut:--------------
*** cmds.c.org	Wed Dec 16 16:24:47 1987
--- cmds.c	Fri Mar 25 15:35:15 1988
***************
*** 547,553 ****
  			cp = value(SHELL);
  		else
  			cp++;
! 		execl(value(SHELL), cp, 0);
  		printf("\r\ncan't execl!\r\n");
  		exit(1);
  	}
--- 547,556 ----
  			cp = value(SHELL);
  		else
  			cp++;
! 		if (strcmp(cp,"sh") == 0)
! 			execl(value(SHELL), cp, 0);
! 		else
! 			execl(value(SHELL), cp, "-b", 0);
  		printf("\r\ncan't execl!\r\n");
  		exit(1);
  	}
-- 
John P. Nelson, M.D., 3811 O'Hara St, Pittsburgh, PA 15213, t:412-624-1769 Dept. of Psychiatry, U. of Pittsburgh
UUCP: { akgua | allegra | cmcl2 | idis | ihnp4 | mi-cec | pitt | psuvax1 | sun | sunrise | vax135 } ! cadre ! jack
ARPA: jack at cadre.dsl.pittsburgh.edu



More information about the Comp.bugs.2bsd mailing list