summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-09-22 21:10:21 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-09-22 21:10:21 +1000
commit6fa8abd58bb8beac0e73ccdba6dfa1414cb1112c (patch)
tree56075cff93f1af7f9a90aea3dc25bc9b5899cbe5
parent631a4a9b3e2d6109b87e59f3cf2dac419d3764fe (diff)
- markus@cvs.openbsd.org 2003/09/19 11:29:40
[ssh-agent.c] provide a ssh-agent specific fatal() function; ok deraadt
-rw-r--r--ChangeLog5
-rw-r--r--ssh-agent.c22
2 files changed, 20 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 05021615d..4707332af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,9 @@
52 - markus@cvs.openbsd.org 2003/09/19 09:03:00 52 - markus@cvs.openbsd.org 2003/09/19 09:03:00
53 [buffer.c] 53 [buffer.c]
54 sign fix in buffer_dump; Jedi/Sector One; pr 3473 54 sign fix in buffer_dump; Jedi/Sector One; pr 3473
55 - markus@cvs.openbsd.org 2003/09/19 11:29:40
56 [ssh-agent.c]
57 provide a ssh-agent specific fatal() function; ok deraadt
55 58
5620030919 5920030919
57 - (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL; 60 - (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL;
@@ -1188,4 +1191,4 @@
1188 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 1191 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
1189 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 1192 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
1190 1193
1191$Id: ChangeLog,v 1.3030 2003/09/22 11:08:21 dtucker Exp $ 1194$Id: ChangeLog,v 1.3031 2003/09/22 11:10:21 dtucker Exp $
diff --git a/ssh-agent.c b/ssh-agent.c
index e1e6cae9b..28a39a934 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -35,7 +35,7 @@
35 35
36#include "includes.h" 36#include "includes.h"
37#include "openbsd-compat/sys-queue.h" 37#include "openbsd-compat/sys-queue.h"
38RCSID("$OpenBSD: ssh-agent.c,v 1.112 2003/09/18 08:49:45 markus Exp $"); 38RCSID("$OpenBSD: ssh-agent.c,v 1.113 2003/09/19 11:29:40 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41#include <openssl/md5.h> 41#include <openssl/md5.h>
@@ -949,7 +949,7 @@ after_select(fd_set *readset, fd_set *writeset)
949} 949}
950 950
951static void 951static void
952cleanup_socket(void *p) 952cleanup_socket(void)
953{ 953{
954 if (socket_name[0]) 954 if (socket_name[0])
955 unlink(socket_name); 955 unlink(socket_name);
@@ -960,17 +960,28 @@ cleanup_socket(void *p)
960static void 960static void
961cleanup_exit(int i) 961cleanup_exit(int i)
962{ 962{
963 cleanup_socket(NULL); 963 cleanup_socket();
964 exit(i); 964 _exit(i);
965} 965}
966 966
967static void 967static void
968cleanup_handler(int sig) 968cleanup_handler(int sig)
969{ 969{
970 cleanup_socket(NULL); 970 cleanup_socket();
971 _exit(2); 971 _exit(2);
972} 972}
973 973
974void
975fatal(const char *fmt,...)
976{
977 va_list args;
978 va_start(args, fmt);
979 do_log(SYSLOG_LEVEL_FATAL, fmt, args);
980 va_end(args);
981 cleanup_socket();
982 _exit(255);
983}
984
974static void 985static void
975check_parent_exists(int sig) 986check_parent_exists(int sig)
976{ 987{
@@ -1209,7 +1220,6 @@ main(int ac, char **av)
1209#endif 1220#endif
1210 1221
1211skip: 1222skip:
1212 fatal_add_cleanup(cleanup_socket, NULL);
1213 new_socket(AUTH_SOCKET, sock); 1223 new_socket(AUTH_SOCKET, sock);
1214 if (ac > 0) { 1224 if (ac > 0) {
1215 mysignal(SIGALRM, check_parent_exists); 1225 mysignal(SIGALRM, check_parent_exists);