Problems with the tty's in openssh + AIX

Tobias Ulbricht up5a at stud.uni-karlsruhe.de
Wed Dec 11 00:49:45 EST 2002


Hi everybody.
I posted this also to comp.sec...ssh, so excuse me for multiple emails.

I downloaded openssh-3.5p1 and compiled under AIX.
Now,
if I run that program, Sandor W. Sklar in bugzilla #124 suggested (see
below),
it works in linux, not in AIX 5.1.
in AIX it produces the same "hang" as the original problems Ihave with
"tclsh"-command. sshd hangs with this output:

debug1: channel 0: read<=0 rfd 11 len 0
debug1: channel 0: read failed
debug1: channel 0: close_read
debug1: channel 0: input open -> drain
debug1: channel 0: ibuf empty
debug1: channel 0: send eof
debug1: channel 0: input drain -> closed

Could it be related to "NON_BLOCKING"of fd=11?
Or to "TCP_NODELAY" of fd=4?
I seem to be the only one having such problems, thus it might be a
config/compilation issue.
CAn anyone at least verify what evil thing this program  does?

telnet/rlogin/ssh-on-linux pass the sshd-test-program below.
I used openssh3.5p1 with no patches.

thanks,tobias.

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
  int tty_fd;
  int old_tty_fd;
  char str[100];

  if ( argc != 2)
    {
      fprintf (stderr,"usage: sshd-test `tty`\n");
      return 1;
    }

  fprintf (stderr,"tty is: %s\n",argv[1]);

  old_tty_fd = open(argv[1],O_RDWR);
  tty_fd = dup(old_tty_fd);    /* 1 will be /dev/tty */
  fprintf (stderr,"dup tty no. is: %d\n",tty_fd);

  close(old_tty_fd);

  strcpy(str,"this is the last thing you will see if sshd is broken.\n");
  fprintf(stderr,"len = %d str = %s",strlen(str),str);
  write(tty_fd,str,strlen(str));

  strcpy(str,"");
  fprintf(stderr,"len = %d str = \"%s\"\n",strlen(str),str);
  write(tty_fd,str,strlen(str));    /* we die here on 433 */

  fprintf(stderr,"if you can read this then all is good.\n");
  return 0;

}






More information about the openssh-unix-dev mailing list