diff options
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index fac2a2c38..5a265e6b8 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include "includes.h" | 11 | #include "includes.h" |
12 | RCSID("$OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $"); | 12 | RCSID("$OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $"); |
13 | 13 | ||
14 | #include "ssh.h" | 14 | #include "ssh.h" |
15 | #include "rsa.h" | 15 | #include "rsa.h" |
@@ -46,7 +46,7 @@ Identity *identities = NULL; | |||
46 | int max_fd = 0; | 46 | int max_fd = 0; |
47 | 47 | ||
48 | /* pid of shell == parent of agent */ | 48 | /* pid of shell == parent of agent */ |
49 | int parent_pid = -1; | 49 | pid_t parent_pid = -1; |
50 | 50 | ||
51 | /* pathname and directory for AUTH_SOCKET */ | 51 | /* pathname and directory for AUTH_SOCKET */ |
52 | char socket_name[1024]; | 52 | char socket_name[1024]; |
@@ -464,7 +464,7 @@ after_select(fd_set *readset, fd_set *writeset) | |||
464 | void | 464 | void |
465 | check_parent_exists(int sig) | 465 | check_parent_exists(int sig) |
466 | { | 466 | { |
467 | if (kill(parent_pid, 0) < 0) { | 467 | if (parent_pid != -1 && kill(parent_pid, 0) < 0) { |
468 | /* printf("Parent has died - Authentication agent exiting.\n"); */ | 468 | /* printf("Parent has died - Authentication agent exiting.\n"); */ |
469 | exit(1); | 469 | exit(1); |
470 | } | 470 | } |
@@ -550,6 +550,7 @@ main(int ac, char **av) | |||
550 | } | 550 | } |
551 | pid = atoi(pidstr); | 551 | pid = atoi(pidstr); |
552 | if (pid < 1) { /* XXX PID_MAX check too */ | 552 | if (pid < 1) { /* XXX PID_MAX check too */ |
553 | /* Yes, PID_MAX check please */ | ||
553 | fprintf(stderr, "%s=\"%s\", which is not a good PID\n", | 554 | fprintf(stderr, "%s=\"%s\", which is not a good PID\n", |
554 | SSH_AGENTPID_ENV_NAME, pidstr); | 555 | SSH_AGENTPID_ENV_NAME, pidstr); |
555 | exit(1); | 556 | exit(1); |