summaryrefslogtreecommitdiffstats
path: root/ssh-agent.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-09-22 13:10:21 +0200
committerDarren Tucker <dtucker@zip.com.au>2003-09-22 13:10:21 +0200
commit6fa8abd58bb8beac0e73ccdba6dfa1414cb1112c (patch)
tree56075cff93f1af7f9a90aea3dc25bc9b5899cbe5 /ssh-agent.c
parent - markus@cvs.openbsd.org 2003/09/19 09:03:00 (diff)
downloadopenssh-6fa8abd58bb8beac0e73ccdba6dfa1414cb1112c.tar.xz
openssh-6fa8abd58bb8beac0e73ccdba6dfa1414cb1112c.zip
- markus@cvs.openbsd.org 2003/09/19 11:29:40
[ssh-agent.c] provide a ssh-agent specific fatal() function; ok deraadt
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c22
1 files changed, 16 insertions, 6 deletions
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 @@
#include "includes.h"
#include "openbsd-compat/sys-queue.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.112 2003/09/18 08:49:45 markus Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.113 2003/09/19 11:29:40 markus Exp $");
#include <openssl/evp.h>
#include <openssl/md5.h>
@@ -949,7 +949,7 @@ after_select(fd_set *readset, fd_set *writeset)
}
static void
-cleanup_socket(void *p)
+cleanup_socket(void)
{
if (socket_name[0])
unlink(socket_name);
@@ -960,17 +960,28 @@ cleanup_socket(void *p)
static void
cleanup_exit(int i)
{
- cleanup_socket(NULL);
- exit(i);
+ cleanup_socket();
+ _exit(i);
}
static void
cleanup_handler(int sig)
{
- cleanup_socket(NULL);
+ cleanup_socket();
_exit(2);
}
+void
+fatal(const char *fmt,...)
+{
+ va_list args;
+ va_start(args, fmt);
+ do_log(SYSLOG_LEVEL_FATAL, fmt, args);
+ va_end(args);
+ cleanup_socket();
+ _exit(255);
+}
+
static void
check_parent_exists(int sig)
{
@@ -1209,7 +1220,6 @@ main(int ac, char **av)
#endif
skip:
- fatal_add_cleanup(cleanup_socket, NULL);
new_socket(AUTH_SOCKET, sock);
if (ac > 0) {
mysignal(SIGALRM, check_parent_exists);