diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2010-01-09 11:17:57 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2010-01-09 11:17:57 +0000 |
commit | 88df32841fd0285d79a0c81f4db4765d75048564 (patch) | |
tree | 86995e46dd9e453dd98f113d0aea3ce8ba3af3c5 /usr.bin/ssh/sshd.c | |
parent | 87c87cd0b94d2b8e04dad83c7db6c62f1ae418f6 (diff) |
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 'usr.bin/ssh/sshd.c')
-rw-r--r-- | usr.bin/ssh/sshd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index ee7a79de981..17cbdc90b94 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/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 @@ -289,6 +289,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)); |