summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-02-25 20:37:21 +1100
committerDarren Tucker <dtucker@zip.com.au>2007-02-25 20:37:21 +1100
commited623966e30140cb5c3f13e491338887a52c2522 (patch)
tree349a4d2a8acb927f5034ba2b2d29a58ddf71567f
parentd04188e70e17b317076f4c7af3359dc439e43f0b (diff)
- dtucker@cvs.openbsd.org 2007/02/21 11:00:05
[sshd.c] Clear alarm() before restarting sshd on SIGHUP. Without this, if there's a SIGALRM pending (for SSH1 key regeneration) when sshd is SIGHUP'ed, the newly exec'ed sshd will get the SIGALRM and not have a handler for it, and the default action will terminate the listening sshd. Analysis and patch from andrew at gaul.org.
-rw-r--r--ChangeLog9
-rw-r--r--sshd.c3
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 33919d4e7..693cb9616 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,13 @@
4 [clientloop.c] 4 [clientloop.c]
5 set maximum packet and window sizes the same for multiplexed clients 5 set maximum packet and window sizes the same for multiplexed clients
6 as normal connections; ok markus@ 6 as normal connections; ok markus@
7 - dtucker@cvs.openbsd.org 2007/02/21 11:00:05
8 [sshd.c]
9 Clear alarm() before restarting sshd on SIGHUP. Without this, if there's
10 a SIGALRM pending (for SSH1 key regeneration) when sshd is SIGHUP'ed, the
11 newly exec'ed sshd will get the SIGALRM and not have a handler for it,
12 and the default action will terminate the listening sshd. Analysis and
13 patch from andrew at gaul.org.
7 14
820070219 1520070219
9 - (dtucker) OpenBSD CVS Sync 16 - (dtucker) OpenBSD CVS Sync
@@ -2749,4 +2756,4 @@
2749 OpenServer 6 and add osr5bigcrypt support so when someone migrates 2756 OpenServer 6 and add osr5bigcrypt support so when someone migrates
2750 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 2757 passwords between UnixWare and OpenServer they will still work. OK dtucker@
2751 2758
2752$Id: ChangeLog,v 1.4620 2007/02/25 09:36:49 dtucker Exp $ 2759$Id: ChangeLog,v 1.4621 2007/02/25 09:37:21 dtucker Exp $
diff --git a/sshd.c b/sshd.c
index 4aa1c98ed..0a76f2d3a 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.348 2006/11/06 21:25:28 markus Exp $ */ 1/* $OpenBSD: sshd.c,v 1.349 2007/02/21 11:00:05 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -305,6 +305,7 @@ sighup_restart(void)
305 logit("Received SIGHUP; restarting."); 305 logit("Received SIGHUP; restarting.");
306 close_listen_socks(); 306 close_listen_socks();
307 close_startup_pipes(); 307 close_startup_pipes();
308 alarm(0); /* alarm timer persists across exec */
308 execv(saved_argv[0], saved_argv); 309 execv(saved_argv[0], saved_argv);
309 logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0], 310 logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
310 strerror(errno)); 311 strerror(errno));