- (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.
This commit is contained in:
Damien Miller 2014-05-21 17:06:46 +10:00
parent 7f1c264d30
commit 18912775cb
4 changed files with 8 additions and 21 deletions

View File

@ -1,3 +1,8 @@
20140521
- (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.
20140519 20140519
- (djm) [rijndael.c rijndael.h] Sync with newly-ressurected versions ine - (djm) [rijndael.c rijndael.h] Sync with newly-ressurected versions ine
OpenBSD OpenBSD

View File

@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.573 2014/05/15 04:58:08 djm Exp $ # $Id: configure.ac,v 1.574 2014/05/21 07:06:47 djm Exp $
# #
# Copyright (c) 1999-2004 Damien Miller # Copyright (c) 1999-2004 Damien Miller
# #
@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
AC_REVISION($Revision: 1.573 $) AC_REVISION($Revision: 1.574 $)
AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C]) AC_LANG([C])
@ -1736,7 +1736,6 @@ AC_CHECK_FUNCS([ \
user_from_uid \ user_from_uid \
usleep \ usleep \
vasprintf \ vasprintf \
vhangup \
vsnprintf \ vsnprintf \
waitpid \ waitpid \
]) ])

View File

@ -25,7 +25,7 @@
#ifndef _DEFINES_H #ifndef _DEFINES_H
#define _DEFINES_H #define _DEFINES_H
/* $Id: defines.h,v 1.179 2014/05/15 04:37:04 djm Exp $ */ /* $Id: defines.h,v 1.180 2014/05/21 07:06:47 djm Exp $ */
/* Constants */ /* Constants */
@ -603,10 +603,6 @@ struct winsize {
# define memmove(s1, s2, n) bcopy((s2), (s1), (n)) # define memmove(s1, s2, n) bcopy((s2), (s1), (n))
#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */ #endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
#if defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX)
# define USE_VHANGUP
#endif /* defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) */
#ifndef GETPGRP_VOID #ifndef GETPGRP_VOID
# include <unistd.h> # include <unistd.h>
# define getpgrp() getpgrp(0) # define getpgrp() getpgrp(0)

View File

@ -99,9 +99,6 @@ void
pty_make_controlling_tty(int *ttyfd, const char *tty) pty_make_controlling_tty(int *ttyfd, const char *tty)
{ {
int fd; int fd;
#ifdef USE_VHANGUP
void *old;
#endif /* USE_VHANGUP */
#ifdef _UNICOS #ifdef _UNICOS
if (setsid() < 0) if (setsid() < 0)
@ -157,21 +154,11 @@ pty_make_controlling_tty(int *ttyfd, const char *tty)
if (setpgrp(0,0) < 0) if (setpgrp(0,0) < 0)
error("SETPGRP %s",strerror(errno)); error("SETPGRP %s",strerror(errno));
#endif /* NEED_SETPGRP */ #endif /* NEED_SETPGRP */
#ifdef USE_VHANGUP
old = signal(SIGHUP, SIG_IGN);
vhangup();
signal(SIGHUP, old);
#endif /* USE_VHANGUP */
fd = open(tty, O_RDWR); fd = open(tty, O_RDWR);
if (fd < 0) { if (fd < 0) {
error("%.100s: %.100s", tty, strerror(errno)); error("%.100s: %.100s", tty, strerror(errno));
} else { } else {
#ifdef USE_VHANGUP
close(*ttyfd);
*ttyfd = fd;
#else /* USE_VHANGUP */
close(fd); close(fd);
#endif /* USE_VHANGUP */
} }
/* Verify that we now have a controlling tty. */ /* Verify that we now have a controlling tty. */
fd = open(_PATH_TTY, O_WRONLY); fd = open(_PATH_TTY, O_WRONLY);