Balazs Scheidler <[EMAIL PROTECTED]> writes:
> Between exams, I'll have some time to work on lsh. (or at least I'll make
> some time available :-)) I thought it would be handy, if lshd could
> allocate a pseudo-tty, so real full-screen programs could be run.
That would be great. Keresztg <[EMAIL PROTECTED]> has written
"quick'n'dirty" pty-support for lsh (it makes lshd allocate a pty, but
doesn't deal with the corresponding protocol messages). It seems he's
busy with exams right now, just like you.
> My question is about how I should allocate that given pseudo tty. I found
> a function openpty() in glibc, but this doesn't seem to be portable. (at
> least I didn't find this one on solaris). Other way would be to try to
> open all /dev/ptyp*, the one which can be successfully opened will be the
> master, and the corresponding /dev/ttyp0 is the slave pty. But what
> happens when we'll have a /dev/ptmx, and will have to use ioctls to
> allocate a pty. This last one seems to be supported by latest linux
> kernels, and seem to be standard in solaris.
I don't know much about ptys. But I'm afraid it is security sensitive;
it has to be done right, or else sessions can be stolen or
eavesdropped by other users. If some system provides an easy way to
do the pty-allocation and do it right, I think that it is a good idea
to use it. I.e, "support'm all, and let autoconf sort it out".
It is also possible to include a copy of openpty from glibc, and let
AC_REPLACE_FUNC use that if it is not provided by the system. (I can't
find openpty() in my copy of the glibc manual, so I don't know what it
does exactly).
/Niels