summaryrefslogtreecommitdiff
path: root/sshpty.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-05-21 17:06:46 +1000
committerDamien Miller <djm@mindrot.org>2014-05-21 17:06:46 +1000
commit18912775cb97c0b1e75e838d3c7d4b56648137b5 (patch)
tree4f9680415a0fa5588caf9d0fc6246e322f515979 /sshpty.c
parent7f1c264d3049cd95234e91970ccb5406e1d15b27 (diff)
- (djm) [commit configure.ac defines.h sshpty.c] don't attempt to use
vhangup on Linux. It doens't work for non-root users, and for them it just messes up the tty settings.
Diffstat (limited to 'sshpty.c')
-rw-r--r--sshpty.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/sshpty.c b/sshpty.c
index bbbc0fefe..a2059b76d 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -99,9 +99,6 @@ void
99pty_make_controlling_tty(int *ttyfd, const char *tty) 99pty_make_controlling_tty(int *ttyfd, const char *tty)
100{ 100{
101 int fd; 101 int fd;
102#ifdef USE_VHANGUP
103 void *old;
104#endif /* USE_VHANGUP */
105 102
106#ifdef _UNICOS 103#ifdef _UNICOS
107 if (setsid() < 0) 104 if (setsid() < 0)
@@ -157,21 +154,11 @@ pty_make_controlling_tty(int *ttyfd, const char *tty)
157 if (setpgrp(0,0) < 0) 154 if (setpgrp(0,0) < 0)
158 error("SETPGRP %s",strerror(errno)); 155 error("SETPGRP %s",strerror(errno));
159#endif /* NEED_SETPGRP */ 156#endif /* NEED_SETPGRP */
160#ifdef USE_VHANGUP
161 old = signal(SIGHUP, SIG_IGN);
162 vhangup();
163 signal(SIGHUP, old);
164#endif /* USE_VHANGUP */
165 fd = open(tty, O_RDWR); 157 fd = open(tty, O_RDWR);
166 if (fd < 0) { 158 if (fd < 0) {
167 error("%.100s: %.100s", tty, strerror(errno)); 159 error("%.100s: %.100s", tty, strerror(errno));
168 } else { 160 } else {
169#ifdef USE_VHANGUP
170 close(*ttyfd);
171 *ttyfd = fd;
172#else /* USE_VHANGUP */
173 close(fd); 161 close(fd);
174#endif /* USE_VHANGUP */
175 } 162 }
176 /* Verify that we now have a controlling tty. */ 163 /* Verify that we now have a controlling tty. */
177 fd = open(_PATH_TTY, O_WRONLY); 164 fd = open(_PATH_TTY, O_WRONLY);