summaryrefslogtreecommitdiffstats
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 33919d4e..693cb961 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,13 @@
[clientloop.c]
set maximum packet and window sizes the same for multiplexed clients
as normal connections; ok markus@
+ - 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.
20070219
- (dtucker) OpenBSD CVS Sync
@@ -2749,4 +2756,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
-$Id: ChangeLog,v 1.4620 2007/02/25 09:36:49 dtucker Exp $
+$Id: ChangeLog,v 1.4621 2007/02/25 09:37:21 dtucker Exp $
diff --git a/sshd.c b/sshd.c
index 4aa1c98e..0a76f2d3 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.348 2006/11/06 21:25:28 markus Exp $ */
+/* $OpenBSD: sshd.c,v 1.349 2007/02/21 11:00:05 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -305,6 +305,7 @@ sighup_restart(void)
logit("Received SIGHUP; restarting.");
close_listen_socks();
close_startup_pipes();
+ alarm(0); /* alarm timer persists across exec */
execv(saved_argv[0], saved_argv);
logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
strerror(errno));