*** comsat.c-	Tue Sep 20 06:10:13 1988
--- comsat.c	Thu Aug  9 16:08:07 1990
***************
*** 183,189 ****
  		dsyslog(LOG_ERR, "fopen of tty %s failed", tty);
  		_exit(-1);
  	}
! 	(void)ioctl(fileno(tp), TIOCGETP, &gttybuf);
  	cr = (gttybuf.sg_flags&CRMOD) && !(gttybuf.sg_flags&RAW) ? "" : "\r";
  	(void)strncpy(name, utp->ut_name, sizeof (utp->ut_name));
  	name[sizeof (name) - 1] = '\0';
--- 183,193 ----
  		dsyslog(LOG_ERR, "fopen of tty %s failed", tty);
  		_exit(-1);
  	}
! 	/* WZV 900809 security check added here */
! 	if (ioctl(fileno(tp), TIOCGETP, &gttybuf)) {
! 		syslog(LOG_ALERT, "%s: not a terminal!", tty);
! 		return;
! 	}
  	cr = (gttybuf.sg_flags&CRMOD) && !(gttybuf.sg_flags&RAW) ? "" : "\r";
  	(void)strncpy(name, utp->ut_name, sizeof (utp->ut_name));
  	name[sizeof (name) - 1] = '\0';
