diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-02-25 20:37:21 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-02-25 20:37:21 +1100 |
commit | ed623966e30140cb5c3f13e491338887a52c2522 (patch) | |
tree | 349a4d2a8acb927f5034ba2b2d29a58ddf71567f /sshd.c | |
parent | d04188e70e17b317076f4c7af3359dc439e43f0b (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.
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)); |