diff options
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index e5232fc9b..f5fce6b2a 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -57,6 +57,10 @@ RCSID("$OpenBSD: ssh-agent.c,v 1.117 2003/12/02 17:01:15 markus Exp $"); | |||
57 | #include "scard.h" | 57 | #include "scard.h" |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #if defined(HAVE_SYS_PRCTL_H) | ||
61 | #include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */ | ||
62 | #endif | ||
63 | |||
60 | typedef enum { | 64 | typedef enum { |
61 | AUTH_UNUSED, | 65 | AUTH_UNUSED, |
62 | AUTH_SOCKET, | 66 | AUTH_SOCKET, |
@@ -1023,6 +1027,11 @@ main(int ac, char **av) | |||
1023 | setegid(getgid()); | 1027 | setegid(getgid()); |
1024 | setgid(getgid()); | 1028 | setgid(getgid()); |
1025 | 1029 | ||
1030 | #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) | ||
1031 | /* Disable ptrace on Linux without sgid bit */ | ||
1032 | prctl(PR_SET_DUMPABLE, 0); | ||
1033 | #endif | ||
1034 | |||
1026 | SSLeay_add_all_algorithms(); | 1035 | SSLeay_add_all_algorithms(); |
1027 | 1036 | ||
1028 | __progname = ssh_get_progname(av[0]); | 1037 | __progname = ssh_get_progname(av[0]); |