Update of /cvsroot/linux-decnet/latd
In directory sc8-pr-cvs1:/tmp/cvs-serv13333
Modified Files:
serversession.cc
Log Message:
Make new pty the controlling TTY for the session
Index: serversession.cc
===================================================================
RCS file: /cvsroot/linux-decnet/latd/serversession.cc,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** serversession.cc 5 Apr 2003 10:01:21 -0000 1.17
--- serversession.cc 13 Apr 2003 12:11:40 -0000 1.18
***************
*** 15,18 ****
--- 15,19 ----
#include <sys/types.h>
#include <sys/time.h>
+ #include <sys/ioctl.h>
#include <sys/resource.h>
#include <stdio.h>
***************
*** 163,166 ****
--- 164,169 ----
int fd = slave_fd;
+ setsid();
+
// Set terminal characteristics
struct termios tio;
***************
*** 168,171 ****
--- 171,175 ----
tio.c_oflag |= ONLCR;
tcsetattr(slave_fd, TCSANOW, &tio);
+ ioctl(fd, TIOCSCTTY, (char *)NULL);
close(master_fd);
***************
*** 176,181 ****
close_all_fds();
-
- setsid();
// Become the requested user.
--- 180,183 ----
|