diff options
Diffstat (limited to 'crypto/openssh/ssh-agent.c')
-rw-r--r-- | crypto/openssh/ssh-agent.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/openssh/ssh-agent.c b/crypto/openssh/ssh-agent.c index d8af4e4..b75d689 100644 --- a/crypto/openssh/ssh-agent.c +++ b/crypto/openssh/ssh-agent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-agent.c,v 1.171 2010/11/21 01:01:13 djm Exp $ */ +/* $OpenBSD: ssh-agent.c,v 1.172 2011/06/03 01:37:40 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1098,7 +1098,11 @@ cleanup_handler(int sig) static void check_parent_exists(void) { - if (parent_pid != -1 && kill(parent_pid, 0) < 0) { + /* + * If our parent has exited then getppid() will return (pid_t)1, + * so testing for that should be safe. + */ + if (parent_pid != -1 && getppid() != parent_pid) { /* printf("Parent has died - Authentication agent exiting.\n"); */ cleanup_socket(); _exit(2); @@ -1156,7 +1160,6 @@ main(int ac, char **av) OpenSSL_add_all_algorithms(); __progname = ssh_get_progname(av[0]); - init_rng(); seed_rng(); while ((ch = getopt(ac, av, "cdksa:t:")) != -1) { |