Ultrix 4.1 TIOCSPGRP peculiarities -- is this correct behaviour?

Chris Metcalf metcalf at masala.lcs.mit.edu
Thu Mar 7 02:15:00 AEST 1991


As a result of the funny Ultrix requirements for getting a control
tty, if you are writing or porting your own rlogind.c be aware that
you have to reset the pgrp after calling vhangup().  The following
diff applies to the Kerberos code we're running here.

Thanks to Ian Allen for tracking down the problem; TFM certainly
doesn't help.

Chris Metcalf

*** /tmp/,RCSt1001681	Wed Mar  6 11:04:31 1991
--- rlogind.c	Wed Mar  6 08:49:08 1991
***************
*** 256,267 ****
   		fatalperror(f, line);
   	if (fchmod(t, 0))
   		fatalperror(f, line);
   	(void)signal(SIGHUP, SIG_IGN);
   	vhangup();
   	(void)signal(SIGHUP, SIG_DFL);
   	t = open(line, O_RDWR);
   	if (t < 0)
   		fatalperror(f, line);
   	{
   		struct sgttyb b;
   
--- 264,285 ----
   		fatalperror(f, line);
   	if (fchmod(t, 0))
   		fatalperror(f, line);
   	(void)signal(SIGHUP, SIG_IGN);
   	vhangup();
   	(void)signal(SIGHUP, SIG_DFL);
+ #ifdef ultrix
+ 	/*
+ 	 * In Ultrix 4.1 (and maybe 4.0), you have to have pgrp = 0 to
+ 	 * get a controlling tty; it doesn't suffice just to have no
+ 	 * controlling terminal at open time (yes, the man page lies).
+ 	 * 	Chris Metcalf
+ 	 */
+ 	if (setpgrp(0,0))
+ 		perror("setpgrp(0,0)");
+ #endif ultrix
   	t = open(line, O_RDWR);
   	if (t < 0)
   		fatalperror(f, line);
   	{
   		struct sgttyb b;
   
--
			Chris Metcalf --- MIT Laboratory for Computer Science
			email to metcalf at lcs.mit.edu, or phone (617) 253-7766



More information about the Comp.unix.ultrix mailing list