diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-22 20:44:00 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-22 20:44:00 +0000 |
commit | 0250da057d8eea11ee76ff5100be41bb2ce2241c (patch) | |
tree | f2a7ccfbc9befd0754f06b9c69d3fa494385fe67 /ssh-agent.c | |
parent | 660076925e6ad3c001835568c786e3f63f75ddab (diff) |
- markus@cvs.openbsd.org 2001/07/20 14:46:11
[ssh-agent.c]
do not exit() from signal handlers; ok deraadt@
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index 84ffe855b..46a1199b1 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.67 2001/07/18 21:40:40 stevesk Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.68 2001/07/20 14:46:11 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -36,7 +36,7 @@ | |||
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include "includes.h" | 38 | #include "includes.h" |
39 | RCSID("$OpenBSD: ssh-agent.c,v 1.67 2001/07/18 21:40:40 stevesk Exp $"); | 39 | RCSID("$OpenBSD: ssh-agent.c,v 1.68 2001/07/20 14:46:11 markus Exp $"); |
40 | 40 | ||
41 | #include <openssl/evp.h> | 41 | #include <openssl/evp.h> |
42 | #include <openssl/md5.h> | 42 | #include <openssl/md5.h> |
@@ -779,20 +779,6 @@ after_select(fd_set *readset, fd_set *writeset) | |||
779 | } | 779 | } |
780 | 780 | ||
781 | static void | 781 | static void |
782 | check_parent_exists(int sig) | ||
783 | { | ||
784 | int save_errno = errno; | ||
785 | |||
786 | if (parent_pid != -1 && kill(parent_pid, 0) < 0) { | ||
787 | /* printf("Parent has died - Authentication agent exiting.\n"); */ | ||
788 | exit(1); | ||
789 | } | ||
790 | signal(SIGALRM, check_parent_exists); | ||
791 | alarm(10); | ||
792 | errno = save_errno; | ||
793 | } | ||
794 | |||
795 | static void | ||
796 | cleanup_socket(void) | 782 | cleanup_socket(void) |
797 | { | 783 | { |
798 | if (socket_name[0]) | 784 | if (socket_name[0]) |
@@ -816,6 +802,20 @@ cleanup_handler(int sig) | |||
816 | } | 802 | } |
817 | 803 | ||
818 | static void | 804 | static void |
805 | check_parent_exists(int sig) | ||
806 | { | ||
807 | int save_errno = errno; | ||
808 | |||
809 | if (parent_pid != -1 && kill(parent_pid, 0) < 0) { | ||
810 | /* printf("Parent has died - Authentication agent exiting.\n"); */ | ||
811 | cleanup_handler(sig); /* safe */ | ||
812 | } | ||
813 | signal(SIGALRM, check_parent_exists); | ||
814 | alarm(10); | ||
815 | errno = save_errno; | ||
816 | } | ||
817 | |||
818 | static void | ||
819 | usage(void) | 819 | usage(void) |
820 | { | 820 | { |
821 | fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION); | 821 | fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION); |