"Jason Titus" <[EMAIL PROTECTED]> writes:

> I did some work with the CVS stuff from yesterday, and it didn't seem to
> help.  I saw there were changes today, but they seemed related to adding a
> new encryption scheme and not to pty stuff.  Have there been changes since
> the 28th snapshot that might affect pty stuff?

I think there are two recent changes to the pty code:

In tty_setctty I commented out the failing call to grantpt():

  #if HAVE_UNIX98_PTYS
    {
      int fd;
  
      /* FIXME: For some reason, it doesn't work to call grantpt() again
       * here. Hopefully, there is some other way to do things right. */
  #if 0
      /* Set up permissions with our new uid. */
      if (grantpt(pty->master) < 0)
        {
          werror("tty_setctty: grantpt() failed,\n"
                 "   (errno = %i): %z\n", errno, strerror(errno));
          return 0;
        }
      if (unlockpt(pty->master) < 0)
        {
          werror("tty_setctty: unlockpt() failed,\n"
                 "   (errno = %i): %z\n", errno, strerror(errno));
          return 0;
        }
  #endif
  
I hope there is some better way to do this part, but I haven't yet
found out how. I also don't know exactly what the problems are with
the current code (which calls grantpt() and unlockpt() too early,
before changing uid).

The other change, that should fix the buffering problems earlier
reported by Keresztg, is the CFMAKERAW-macro in tty.h, which should
look like

#define CFMAKERAW(ios) do {                                                \
  (ios)->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); \
  (ios)->c_oflag &= ~OPOST;                                                \
  (ios)->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);                     \
  (ios)->c_cflag &= ~(CSIZE|PARENB); (ios)->c_cflag |= CS8;                \
  (ios)->c_cc[VMIN] = 3; (ios)->c_cc[VTIME] = 2;                           \
} while(0)

Earlier VMIN was 4 (it's the same attribute as EOF, which was ^D ==
4...) and VTIME was either zero or too large (don't know which).

This latter change is not tested (and not checked in yet).

Regards,
/Niels

Reply via email to