summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2020-01-23 07:10:22 +0000
committerDarren Tucker <dtucker@dtucker.net>2020-01-23 18:51:25 +1100
commit3bf2a6ac791d64046a537335a0f1d5e43579c5ad (patch)
tree76fcc0f1be306541c074be4aed3aca66023f0962 /ssh.c
parente027c044c796f3a01081a91bee55741204283f28 (diff)
upstream: Replace all calls to signal(2) with a wrapper around
sigaction(2). This wrapper blocks all other signals during the handler preventing races between handlers, and sets SA_RESTART which should reduce the potential for short read/write operations. OpenBSD-Commit-ID: 5e047663fd77a40d7b07bdabe68529df51fd2519
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ssh.c b/ssh.c
index 947558d1c..c0511f2a0 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.511 2020/01/05 16:28:22 beck Exp $ */ 1/* $OpenBSD: ssh.c,v 1.512 2020/01/23 07:10:22 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
@@ -1535,8 +1535,8 @@ main(int ac, char **av)
1535 options.num_system_hostfiles); 1535 options.num_system_hostfiles);
1536 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles); 1536 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles);
1537 1537
1538 signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */ 1538 ssh_signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */
1539 signal(SIGCHLD, main_sigchld_handler); 1539 ssh_signal(SIGCHLD, main_sigchld_handler);
1540 1540
1541 /* Log into the remote system. Never returns if the login fails. */ 1541 /* Log into the remote system. Never returns if the login fails. */
1542 ssh_login(ssh, &sensitive_data, host, (struct sockaddr *)&hostaddr, 1542 ssh_login(ssh, &sensitive_data, host, (struct sockaddr *)&hostaddr,