summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sshd.c b/sshd.c
index 60b2aaf73..6f8f11a3b 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.549 2020/01/31 23:13:04 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.552 2020/03/13 04:01:57 djm 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
@@ -317,7 +317,6 @@ sighup_restart(void)
317 platform_pre_restart(); 317 platform_pre_restart();
318 close_listen_socks(); 318 close_listen_socks();
319 close_startup_pipes(); 319 close_startup_pipes();
320 alarm(0); /* alarm timer persists across exec */
321 ssh_signal(SIGHUP, SIG_IGN); /* will be restored after exec */ 320 ssh_signal(SIGHUP, SIG_IGN); /* will be restored after exec */
322 execv(saved_argv[0], saved_argv); 321 execv(saved_argv[0], saved_argv);
323 logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0], 322 logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
@@ -1110,7 +1109,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
1110 for (i = 0; i < num_listen_socks; i++) 1109 for (i = 0; i < num_listen_socks; i++)
1111 if (listen_socks[i] > maxfd) 1110 if (listen_socks[i] > maxfd)
1112 maxfd = listen_socks[i]; 1111 maxfd = listen_socks[i];
1113 /* pipes connected to unauthenticated childs */ 1112 /* pipes connected to unauthenticated child sshd processes */
1114 startup_pipes = xcalloc(options.max_startups, sizeof(int)); 1113 startup_pipes = xcalloc(options.max_startups, sizeof(int));
1115 startup_flags = xcalloc(options.max_startups, sizeof(int)); 1114 startup_flags = xcalloc(options.max_startups, sizeof(int));
1116 for (i = 0; i < options.max_startups; i++) 1115 for (i = 0; i < options.max_startups; i++)
@@ -2085,12 +2084,7 @@ main(int ac, char **av)
2085 fcntl(sock_out, F_SETFD, FD_CLOEXEC); 2084 fcntl(sock_out, F_SETFD, FD_CLOEXEC);
2086 fcntl(sock_in, F_SETFD, FD_CLOEXEC); 2085 fcntl(sock_in, F_SETFD, FD_CLOEXEC);
2087 2086
2088 /* 2087 /* We will not restart on SIGHUP since it no longer makes sense. */
2089 * Disable the key regeneration alarm. We will not regenerate the
2090 * key since we are no longer in a position to give it to anyone. We
2091 * will not restart on SIGHUP since it no longer makes sense.
2092 */
2093 alarm(0);
2094 ssh_signal(SIGALRM, SIG_DFL); 2088 ssh_signal(SIGALRM, SIG_DFL);
2095 ssh_signal(SIGHUP, SIG_DFL); 2089 ssh_signal(SIGHUP, SIG_DFL);
2096 ssh_signal(SIGTERM, SIG_DFL); 2090 ssh_signal(SIGTERM, SIG_DFL);
@@ -2161,8 +2155,9 @@ main(int ac, char **av)
2161 if (!debug_flag) 2155 if (!debug_flag)
2162 alarm(options.login_grace_time); 2156 alarm(options.login_grace_time);
2163 2157
2164 if (kex_exchange_identification(ssh, -1, options.version_addendum) != 0) 2158 if ((r = kex_exchange_identification(ssh, -1,
2165 cleanup_exit(255); /* error already logged */ 2159 options.version_addendum)) != 0)
2160 sshpkt_fatal(ssh, r, "banner exchange");
2166 2161
2167 ssh_packet_set_nonblocking(ssh); 2162 ssh_packet_set_nonblocking(ssh);
2168 2163