diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2020-01-23 07:10:22 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-01-23 18:51:25 +1100 |
commit | 3bf2a6ac791d64046a537335a0f1d5e43579c5ad (patch) | |
tree | 76fcc0f1be306541c074be4aed3aca66023f0962 /ssh-agent.c | |
parent | e027c044c796f3a01081a91bee55741204283f28 (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-agent.c')
-rw-r--r-- | ssh-agent.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index 09d12dc3f..dd5d21d5a 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.251 2019/12/13 19:09:10 djm Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.252 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 |
@@ -1404,10 +1404,10 @@ skip: | |||
1404 | if (ac > 0) | 1404 | if (ac > 0) |
1405 | parent_alive_interval = 10; | 1405 | parent_alive_interval = 10; |
1406 | idtab_init(); | 1406 | idtab_init(); |
1407 | signal(SIGPIPE, SIG_IGN); | 1407 | ssh_signal(SIGPIPE, SIG_IGN); |
1408 | signal(SIGINT, (d_flag | D_flag) ? cleanup_handler : SIG_IGN); | 1408 | ssh_signal(SIGINT, (d_flag | D_flag) ? cleanup_handler : SIG_IGN); |
1409 | signal(SIGHUP, cleanup_handler); | 1409 | ssh_signal(SIGHUP, cleanup_handler); |
1410 | signal(SIGTERM, cleanup_handler); | 1410 | ssh_signal(SIGTERM, cleanup_handler); |
1411 | 1411 | ||
1412 | if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) | 1412 | if (pledge("stdio rpath cpath unix id proc exec", NULL) == -1) |
1413 | fatal("%s: pledge: %s", __progname, strerror(errno)); | 1413 | fatal("%s: pledge: %s", __progname, strerror(errno)); |