summaryrefslogtreecommitdiffstats
path: root/sshd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-09 12:28:43 +0100
committerDarren Tucker <dtucker@zip.com.au>2010-01-09 12:28:43 +0100
commit2c671bf6a8b93489624fafa79a40cb69d7a53ba3 (patch)
tree8b5cb871df7d362f1ed3d801653d83a27da5ae49 /sshd.c
parent - dtucker@cvs.openbsd.org 2010/01/09 11:13:02 (diff)
downloadopenssh-2c671bf6a8b93489624fafa79a40cb69d7a53ba3.tar.xz
openssh-2c671bf6a8b93489624fafa79a40cb69d7a53ba3.zip
- dtucker@cvs.openbsd.org 2010/01/09 11:17:56
[sshd.c] Afer sshd receives a SIGHUP, ignore subsequent HUPs while sshd re-execs itself. Prevents two HUPs in quick succession from resulting in sshd dying. bz#1692, patch from Colin Watson via Ubuntu.
Diffstat (limited to '')
-rw-r--r--sshd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sshd.c b/sshd.c
index e23d462ee..bdaf1574a 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.368 2009/10/28 16:38:18 reyk Exp $ */
+/* $OpenBSD: sshd.c,v 1.369 2010/01/09 11:17:56 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -309,6 +309,7 @@ sighup_restart(void)
close_listen_socks();
close_startup_pipes();
alarm(0); /* alarm timer persists across exec */
+ signal(SIGHUP, SIG_IGN); /* will be restored after exec */
execv(saved_argv[0], saved_argv);
logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
strerror(errno));