[5425] in Kerberos

home help back first fref pref prev next nref lref last post

Re: Solaris2 kerberos problem: no access to tty; thus no job control . .

daemon@ATHENA.MIT.EDU (Christopher Hylands)
Mon Jun 26 17:54:37 1995

To: kerberos@MIT.EDU
Date: 26 Jun 1995 21:32:03 GMT
From: cxh@markov.berkeley.edu (Christopher Hylands)

I wrote:
   I've run up against the following bug under Solaris2.4:

   When I rlogin to a Solaris2 host running klogind, I get the message:
   Warning: no access to tty; thus no job control in this shell...

   This message comes from /bin/csh.  Running a trace shows that just
   before the message is output, a TIOCGPGRP ioctol is failing:

	   ioctl(18, TCGETA, 0xEFFFFC5C)			= 0
	   ioctl(18, TIOCGPGRP, 0x00047A88)		Err#25 ENOTTY
	   ioctl(17, TIOCLGET, 0xEFFFFB5C)			= 0
	   write(17, " W a r n i n g :   n o  ".., 64)	= 64

   The termio man page says:
	ENOTTY         The file associated with fildes is not a terminal.


   I get a similar message with tcsh-6.05, where tcgetpgrp() is failing.

   I get this message with Cygnus' CNS code, and with a local KerberosIV
   installation.  My guess is that this is some sort of nasty Solaris
   botch.

   Interestingly, the CNS telnetd works fine, I have job control and
   everything.  Both telnetd and klogind are using the same login.krb
   binary.

-----

This was a real bear to figure out.  It turns out that /bin/csh was
unable to get any pagegroup information because there was no tty
associated with the log in.  Here's how I found out:

If I set my shell to /usr/local/bin/csh.tst, which contains

	#!/bin/sh
	truss -o /tmp/tr csh

and add /usr/local/bin/csh.tst to <CODE>/etc/shells
Then /tmp/tr contains

	fcntl(2, F_DUPFD, 0x00000012)			= 18
	getpid()					= 14302 [14301]
	fcntl(18, F_SETFD, 0x00000001)			= 0
	[. . .]
	ioctl(18, TCGETA, 0xEFFFFC5C)			= 0
	ioctl(18, TIOCGPGRP, 0x00047A88)		Err#25 ENOTTY
	ioctl(17, TIOCLGET, 0xEFFFFB5C)			= 0
	write(17, " W a r n i n g :   n o  ".., 64)	= 64

The termio man page says:
     ENOTTY         The file associated with fildes is not a terminal.

I got something similar with tcsh.  After looking around at the Cygnus
CNS source code, I realized that the fix was to edit login_tty() in
our local kerberosIV/libexec/telnetd/sys_term.c and close and reopen
the tty.  I'm not sure why this works, but it does.  (The changes
below are relative to a fairly hacked up version of kerberosIV, so
they might not work as is, but you get the idea.)


rcsdiff -c sys_term.c
===================================================================
RCS file: RCS/sys_term.c,v
retrieving revision 1.8
diff -c -r1.8 sys_term.c
*** /tmp/T0a001jT	Sun Jun 25 17:35:04 1995
--- sys_term.c	Sun Jun 25 16:40:28 1995
***************
*** 1358,1363 ****
--- 1358,1365 ----
  #  endif /* __hpux || SOLARIS */
  #  ifndef SOLARIS
  	close(open(ptyline, O_RDWR));
+ #  else
+ 	close(open(line, O_RDWR));
  #  endif /* !SOLARIS */
  # endif
  	if (t != 0)

------------------------------------------------------------------------


I also fixed a problem where Stty showed an output speed of 0 on a DEC
mips machine
stty
new tty, input speed 38400 baud output speed 0 baud ; -tabs crtbs crterase crtkill ctlecho 
decctlq 


The fix is to change kerberosIV/usr.bin/kerberos/rlogin.c:

rcsdiff -c rlogin.c
===================================================================
RCS file: RCS/rlogin.c,v
retrieving revision 1.9
diff -c -r1.9 rlogin.c
*** /tmp/T0a001kU	Sun Jun 25 17:45:54 1995
--- rlogin.c	Sun Jun 25 16:39:39 1995
***************
*** 468,474 ****
--- 468,478 ----
  #ifdef __hpux
  	return (speeds[tt.c_cflag & CBAUD]);
  #else /* !__hpux */
+ #if defined(__sun) && (defined(__SVR4) || defined(__svr4__))
+ 	return (speeds[(int)cfgetospeed(&tt)]);
+ #else
  	return (speeds[(int)cfgetispeed(&tt)]);
+ #endif
  #endif /* __hpux */
  #endif /* MIPSEL */
  }

---------------------------------------------------------------------------
Also for our hacked up version of kerberosIV, we were getting
/etc/motd and 'you have mail' echoed twice.  The solution was to edit
kerberosIV/usr.bin/login/login.c and #ifdef out the lines that call
motd() and that check for mail.  Under So-lose-us, these are taken
care of in /etc/.login (I think).

My current problem is that connecting from Macs results in some sort
of control character problem, where pine behaves oddly.  I'm also
seeing CR/LF problems.

-Christopher
--
Christopher Hylands			University of California
cxh@eecs.berkeley.edu 			558 Cory Hall #1770
ph: (510)643-9841 fax:(510)642-2739	Berkeley, CA 94720-1770
home: (510)526-4010 (if busy -4068)	(Office: 493 Cory. US Mail: 558 Cory.)

home help back first fref pref prev next nref lref last post