rlogind: don't call forkpty()
We can no longer call forkpty (a convenience routine that combines
openpty, fork, and login_tty) because, with forkpty, the slave end of
the pty is open only in the child process. The child process execs
/bin/login which now closes all open file descriptors before doing
a vhangup (see lkml.org/lkml/2012/6/5/145), and this resets packet
mode on the pty, undoing the effect of the ioctl(master, TIOCPKT,
&on) call made by the parent.
Instead, we call openpty, fork, and login_tty individually, so
that we can keep a file descriptor to the slave open in the parent
process, thereby retaining packet mode even when the child closes
file descriptors to call vhangup.
Patch contributed by Philip Spencer, <pspencer@fields.utoronto.ca>.
Resolves RHBZ #947213.
Signed-off-by: Michal Sekletar <msekleta@redhat.com>