summaryrefslogtreecommitdiff
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
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.
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac5
-rw-r--r--defines.h6
-rw-r--r--sshpty.c13
4 files changed, 8 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d8b9af09..8ad8b1a4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
120140521
2 - (djm) [commit configure.ac defines.h sshpty.c] don't attempt to use
3 vhangup on Linux. It doens't work for non-root users, and for them
4 it just messes up the tty settings.
5
120140519 620140519
2 - (djm) [rijndael.c rijndael.h] Sync with newly-ressurected versions ine 7 - (djm) [rijndael.c rijndael.h] Sync with newly-ressurected versions ine
3 OpenBSD 8 OpenBSD
diff --git a/configure.ac b/configure.ac
index 058cfd090..7a89b57e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.573 2014/05/15 04:58:08 djm Exp $ 1# $Id: configure.ac,v 1.574 2014/05/21 07:06:47 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.573 $) 18AC_REVISION($Revision: 1.574 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C]) 20AC_LANG([C])
21 21
@@ -1736,7 +1736,6 @@ AC_CHECK_FUNCS([ \
1736 user_from_uid \ 1736 user_from_uid \
1737 usleep \ 1737 usleep \
1738 vasprintf \ 1738 vasprintf \
1739 vhangup \
1740 vsnprintf \ 1739 vsnprintf \
1741 waitpid \ 1740 waitpid \
1742]) 1741])
diff --git a/defines.h b/defines.h
index 9e383020b..b3df1e230 100644
--- a/defines.h
+++ b/defines.h
@@ -25,7 +25,7 @@
25#ifndef _DEFINES_H 25#ifndef _DEFINES_H
26#define _DEFINES_H 26#define _DEFINES_H
27 27
28/* $Id: defines.h,v 1.179 2014/05/15 04:37:04 djm Exp $ */ 28/* $Id: defines.h,v 1.180 2014/05/21 07:06:47 djm Exp $ */
29 29
30 30
31/* Constants */ 31/* Constants */
@@ -603,10 +603,6 @@ struct winsize {
603# define memmove(s1, s2, n) bcopy((s2), (s1), (n)) 603# define memmove(s1, s2, n) bcopy((s2), (s1), (n))
604#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */ 604#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
605 605
606#if defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX)
607# define USE_VHANGUP
608#endif /* defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) */
609
610#ifndef GETPGRP_VOID 606#ifndef GETPGRP_VOID
611# include <unistd.h> 607# include <unistd.h>
612# define getpgrp() getpgrp(0) 608# define getpgrp() getpgrp(0)
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);