Balazs Scheidler <[EMAIL PROTECTED]> writes:

> What would you think about splitting server.c? I would move the
> server_session releated code to server_session.c, since I wouldn't want to
> add tcp forwarding code to the already quite large file.

Sounds reasonable. Or perhaps session.c, if there is code that can be
shared by both sides. Several requests and operations on channels of
type ssh-session can be sent, received and processed by either side.

However, I think it may be wise to wait with that until the next
snapshot, to help syncronizing all patches.

I'll try to get a new snapshot out tonight. As I'm on Solaris-2.6 now,
I think I have to add a configure option to disable tty handling
completely, as it will take some more time until we have SysV type tty
handling.

BTW, the GNU libc manual contains the following sysv-like pty
allocation function, except tht the getpt is described as a GNU
extension. Perhaps that code can be borrowed from glibc?

     int
     open_pty_pair (int *amaster, int *aslave)
     {
       int master, slave;
       char *name

       master = getpt ();
       if (master < 0)
         return 0;

       if (grantpt (master) < 0 || unlockpt (master) < 0)
         goto close_master;
       name = ptsname (master);
       if (name == NULL)
         goto close_master;

       slave = open (name, O_RDWR);
       if (slave == -1)
         goto close_master;

       if (isastream (slave))
         {
           if (ioctl (slave, I_PUSH, "ptem") < 0
               || ioctl (slave, I_PUSH, "ldterm") < 0)
             goto close_slave;
         }

       *amaster = master;
       *aslave = slave;
       return 1;

     close_slave:
       close (slave);

     close_master:
       close (master);
       return 0;
     }

Unfortunately, I don't have any definitive docs on SysV, just the
Solaris man-pages, and they are not always clear about what is
standard SysV and what is solaris-specific.

/Niels

Reply via email to