summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ssh-agent.c b/ssh-agent.c
index 6f89dd5ca..821ee26f4 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.40 2000/11/14 23:48:55 markus Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.41 2000/11/30 18:33:05 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: ssh-agent.c,v 1.40 2000/11/14 23:48:55 markus Exp $"); 40RCSID("$OpenBSD: ssh-agent.c,v 1.41 2000/11/30 18:33:05 markus Exp $");
41 41
42#include "ssh.h" 42#include "ssh.h"
43#include "rsa.h" 43#include "rsa.h"
@@ -674,6 +674,7 @@ main(int ac, char **av)
674 fd_set readset, writeset; 674 fd_set readset, writeset;
675 int sock, c_flag = 0, k_flag = 0, s_flag = 0, ch; 675 int sock, c_flag = 0, k_flag = 0, s_flag = 0, ch;
676 struct sockaddr_un sunaddr; 676 struct sockaddr_un sunaddr;
677 struct rlimit rlim;
677 pid_t pid; 678 pid_t pid;
678 char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid]; 679 char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid];
679 extern int optind; 680 extern int optind;
@@ -804,6 +805,12 @@ main(int ac, char **av)
804 close(1); 805 close(1);
805 close(2); 806 close(2);
806 807
808 /* deny core dumps, since memory contains unencrypted private keys */
809 rlim.rlim_cur = rlim.rlim_max = 0;
810 if (setrlimit(RLIMIT_CORE, &rlim) < 0) {
811 perror("setrlimit rlimit_core failed");
812 cleanup_exit(1);
813 }
807 if (setsid() == -1) { 814 if (setsid() == -1) {
808 perror("setsid"); 815 perror("setsid");
809 cleanup_exit(1); 816 cleanup_exit(1);