[comp.windows.x] funny xterm

svenole@vest.sdata.no (Sven Ole Skrivervik) (07/09/90)

Hello xperts.
I've experienced a funny thing with R4-xterm when compiling it on 
a pyramid. It works ok most of the time  but behaves strange when using
programs which prompts you for a password. It looks like there is 
displayed a linefeed/newline after the "Passwd :" with the obviuos 
"Sorry" as the result. The problem just occurs when it`s a local program 
which prompts you for the passwd. (Rlogin and telnet behaves ok but su
and ftp don't.) In fact I can telnet to myself with no problems.

pyramid% su <return>
Passwd:
Sorry
pyramid%

pyramid% ftp sun <return>
220 sun FTP server (SunOS 4.0) ready.
Name (sun:svenole): <return>
331 Password required for svenole.
Password:
500 'PASS ': command not understood.
Login failed.
ftp>

I can log in to the pyramid from a local xterm (sun) and there is no
problems whatsoever. The R3 xterm on pyramid had no such problem.
I'm running OSx5.0c

Do the pyramid display a special character after the "Passwd:" which
the R4 xterm handles like a linefeed/newline??  Do you xperts have
any idea on what might be the problem and what to do to solve it??

- Sven
  svenole@vest.sdata.no

bg@cyklop.nada.kth.se (Bj|rn Gr|nvall) (07/20/90)

>
>   Hello xperts.
>   I've experienced a funny thing with R4-xterm when compiling it on 
>   a pyramid. It works ok most of the time  but behaves strange when using
>   programs which prompts you for a password. It looks like there is 
>   displayed a linefeed/newline after the "Passwd :" with the obviuos 
>   "Sorry" as the result. The problem just occurs when it`s a local program 
>   which prompts you for the passwd. (Rlogin and telnet behaves ok but su
>   and ftp don't.) In fact I can telnet to myself with no problems.
>
>   pyramid% su <return>
>   Passwd:
>   Sorry
>   pyramid%
>
>   pyramid% ftp sun <return>
>   220 sun FTP server (SunOS 4.0) ready.
>   Name (sun:svenole): <return>
>   331 Password required for svenole.
>   Password:
>   500 'PASS ': command not understood.
>   Login failed.
>   ftp>
>
>   I can log in to the pyramid from a local xterm (sun) and there is no
>   problems whatsoever. The R3 xterm on pyramid had no such problem.
>   I'm running OSx5.0c
>
>   Do the pyramid display a special character after the "Passwd:" which
>   the R4 xterm handles like a linefeed/newline??  Do you xperts have
>   any idea on what might be the problem and what to do to solve it??
>
>   - Sven
>     svenole@vest.sdata.no
This is NOT a problem with xterm. The problem is really someplace
inside OSx. The problem is that whenever i file is opened for reading
it shuld be possible to read from it, however OSx doesen't think that
when the file is /dev/tty associated whith a pty inside an xterm. I
have mentioned this in comp.sys.pyramid a number of times but most
probably the OSx hackers don't read news. Here follows a short program
that triggers the bug.

#include <stdio.h>
#include <fcntl.h>

int
main()
{
  static char buff[1024];
  int n;
  int fd = open("/dev/tty", O_RDONLY);
  if (fd == -1)
    {
      perror("Could not open /dev/tty for reading");
      exit(1);
    }
  printf("Successfully opened /dev/tty for reading\n");
  n = read(fd, buff, 1024);
  if (n == -1)
    {
      perror("Could not read from file opened for reading!!!! ");
      exit(1);
    }
  printf("%s\n", buff);
  exit(0);
}

If you start script inside the xterm to get a fresh pty the problem
goes away.

	Bj|rn
--
Bjorn Gronvall					(Bj|rn Gr|nvall)
Royal Institute of Technology, NADA
S - 100 44 Stockholm 
Sweden
email: bg@nada.kth.se
fax:   +46 -8 7900930
phone: +46 -8 7909101