summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-12-01 23:29:24 +0000
committerDamien Miller <djm@mindrot.org>2015-12-04 15:14:58 +1100
commitd952162b3c158a8f23220587bb6c8fcda75da551 (patch)
tree4fbcbc74a2e9cc9ceb3116dabc0aeed93b5eaca5 /ssh-agent.c
parentf0191d7c8e76e30551084b79341886d9bb38e453 (diff)
upstream commit
basic pledge() for ssh-agent, more refinement needed Upstream-ID: 5b5b03c88162fce549e45e1b6dd833f20bbb5e13
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ssh-agent.c b/ssh-agent.c
index a335ea33d..38879335d 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.204 2015/07/08 20:24:02 markus Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.205 2015/12/01 23:29:24 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
@@ -1402,6 +1402,9 @@ skip:
1402 signal(SIGTERM, cleanup_handler); 1402 signal(SIGTERM, cleanup_handler);
1403 nalloc = 0; 1403 nalloc = 0;
1404 1404
1405 if (pledge("stdio unix exec", NULL) != 0)
1406 fatal("%s: pledge: %s", __progname, strerror(errno));
1407
1405 while (1) { 1408 while (1) {
1406 prepare_select(&readsetp, &writesetp, &max_fd, &nalloc, &tvp); 1409 prepare_select(&readsetp, &writesetp, &max_fd, &nalloc, &tvp);
1407 result = select(max_fd + 1, readsetp, writesetp, NULL, tvp); 1410 result = select(max_fd + 1, readsetp, writesetp, NULL, tvp);