mirror of git://anongit.mindrot.org/openssh.git
- markus@cvs.openbsd.org 2003/09/19 17:43:35
[clientloop.c sshtty.c sshtty.h] remove fatal callbacks from client code; ok deraadt
This commit is contained in:
parent
8654d16f0f
commit
9a2c4cddad
|
@ -68,6 +68,9 @@
|
|||
[scp.c]
|
||||
error handling for remote-remote copy; #638; report Harald Koenig;
|
||||
ok millert, fgs, henning, deraadt
|
||||
- markus@cvs.openbsd.org 2003/09/19 17:43:35
|
||||
[clientloop.c sshtty.c sshtty.h]
|
||||
remove fatal callbacks from client code; ok deraadt
|
||||
|
||||
20030919
|
||||
- (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL;
|
||||
|
@ -1204,4 +1207,4 @@
|
|||
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
|
||||
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
|
||||
|
||||
$Id: ChangeLog,v 1.3035 2003/09/22 11:14:55 dtucker Exp $
|
||||
$Id: ChangeLog,v 1.3036 2003/09/22 11:16:05 dtucker Exp $
|
||||
|
|
26
clientloop.c
26
clientloop.c
|
@ -59,7 +59,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: clientloop.c,v 1.112 2003/06/28 16:23:06 deraadt Exp $");
|
||||
RCSID("$OpenBSD: clientloop.c,v 1.113 2003/09/19 17:43:35 markus Exp $");
|
||||
|
||||
#include "ssh.h"
|
||||
#include "ssh1.h"
|
||||
|
@ -139,7 +139,6 @@ leave_non_blocking(void)
|
|||
if (in_non_blocking_mode) {
|
||||
(void) fcntl(fileno(stdin), F_SETFL, 0);
|
||||
in_non_blocking_mode = 0;
|
||||
fatal_remove_cleanup((void (*) (void *)) leave_non_blocking, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +149,6 @@ enter_non_blocking(void)
|
|||
{
|
||||
in_non_blocking_mode = 1;
|
||||
(void) fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
|
||||
fatal_add_cleanup((void (*) (void *)) leave_non_blocking, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -844,8 +842,7 @@ client_channel_closed(int id, void *arg)
|
|||
id, session_ident);
|
||||
channel_cancel_cleanup(id);
|
||||
session_closed = 1;
|
||||
if (in_raw_mode())
|
||||
leave_raw_mode();
|
||||
leave_raw_mode();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1034,11 +1031,8 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
|
|||
if (!isatty(fileno(stderr)))
|
||||
unset_nonblock(fileno(stderr));
|
||||
|
||||
if (received_signal) {
|
||||
if (in_non_blocking_mode) /* XXX */
|
||||
leave_non_blocking();
|
||||
if (received_signal)
|
||||
fatal("Killed by signal %d.", (int) received_signal);
|
||||
}
|
||||
|
||||
/*
|
||||
* In interactive mode (with pseudo tty) display a message indicating
|
||||
|
@ -1387,3 +1381,17 @@ client_init_dispatch(void)
|
|||
else
|
||||
client_init_dispatch_15();
|
||||
}
|
||||
|
||||
/* client specific fatal cleanup */
|
||||
void
|
||||
fatal(const char *fmt,...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
do_log(SYSLOG_LEVEL_FATAL, fmt, args);
|
||||
va_end(args);
|
||||
leave_raw_mode();
|
||||
leave_non_blocking();
|
||||
_exit(255);
|
||||
}
|
||||
|
|
12
sshtty.c
12
sshtty.c
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: sshtty.c,v 1.4 2003/07/16 10:36:28 markus Exp $");
|
||||
RCSID("$OpenBSD: sshtty.c,v 1.5 2003/09/19 17:43:35 markus Exp $");
|
||||
|
||||
#include "sshtty.h"
|
||||
#include "log.h"
|
||||
|
@ -43,12 +43,6 @@ RCSID("$OpenBSD: sshtty.c,v 1.4 2003/07/16 10:36:28 markus Exp $");
|
|||
static struct termios _saved_tio;
|
||||
static int _in_raw_mode = 0;
|
||||
|
||||
int
|
||||
in_raw_mode(void)
|
||||
{
|
||||
return _in_raw_mode;
|
||||
}
|
||||
|
||||
struct termios
|
||||
get_saved_tio(void)
|
||||
{
|
||||
|
@ -64,8 +58,6 @@ leave_raw_mode(void)
|
|||
perror("tcsetattr");
|
||||
else
|
||||
_in_raw_mode = 0;
|
||||
|
||||
fatal_remove_cleanup((void (*) (void *)) leave_raw_mode, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -94,6 +86,4 @@ enter_raw_mode(void)
|
|||
perror("tcsetattr");
|
||||
else
|
||||
_in_raw_mode = 1;
|
||||
|
||||
fatal_add_cleanup((void (*) (void *)) leave_raw_mode, NULL);
|
||||
}
|
||||
|
|
3
sshtty.h
3
sshtty.h
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: sshtty.h,v 1.2 2001/06/26 17:27:25 markus Exp $ */
|
||||
/* $OpenBSD: sshtty.h,v 1.3 2003/09/19 17:43:35 markus Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
|
@ -40,7 +40,6 @@
|
|||
|
||||
#include <termios.h>
|
||||
|
||||
int in_raw_mode(void);
|
||||
struct termios get_saved_tio(void);
|
||||
void leave_raw_mode(void);
|
||||
void enter_raw_mode(void);
|
||||
|
|
Loading…
Reference in New Issue