]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2002/02/22 12:20:34
authormouring <mouring>
Tue, 26 Feb 2002 17:52:14 +0000 (17:52 +0000)
committermouring <mouring>
Tue, 26 Feb 2002 17:52:14 +0000 (17:52 +0000)
     [log.c log.h ssh-keyscan.c]
     overwrite fatal() in ssh-keyscan.c; fixes pr 2354; ok provos@

ChangeLog
log.c
log.h
ssh-keyscan.c

index 8d9b4bb71033856dc96795ab32a978277b2a6631..c1bddc01e9e13631e98fbf88b14ba4464f854b8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,9 @@
      [auth-krb5.c]
      krb5_get_err_text() does not like context==NULL; he@nordu.net via google; 
      ok provos@
+   - markus@cvs.openbsd.org 2002/02/22 12:20:34
+     [log.c log.h ssh-keyscan.c]
+     overwrite fatal() in ssh-keyscan.c; fixes pr 2354; ok provos@
 
 20020225
  - (bal) Last AIX patch.  Moved aix_usrinfo() outside of do_setuserconext()
diff --git a/log.c b/log.c
index 5b25b5929029bf76b4ecd8c8af72898bf2b78a6d..c88f632c9e3638a10c43e82ba4730503446836d8 100644 (file)
--- a/log.c
+++ b/log.c
@@ -34,7 +34,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: log.c,v 1.21 2002/02/04 12:15:25 markus Exp $");
+RCSID("$OpenBSD: log.c,v 1.22 2002/02/22 12:20:34 markus Exp $");
 
 #include "log.h"
 #include "xmalloc.h"
@@ -88,8 +88,6 @@ static struct {
        { NULL,         SYSLOG_LEVEL_NOT_SET }
 };
 
-static void     do_log(LogLevel level, const char *fmt, va_list args);
-
 SyslogFacility
 log_facility_number(char *name)
 {
@@ -111,17 +109,6 @@ log_level_number(char *name)
                                return log_levels[i].val;
        return SYSLOG_LEVEL_NOT_SET;
 }
-/* Fatal messages.  This function never returns. */
-
-void
-fatal(const char *fmt,...)
-{
-       va_list args;
-       va_start(args, fmt);
-       do_log(SYSLOG_LEVEL_FATAL, fmt, args);
-       va_end(args);
-       fatal_cleanup();
-}
 
 /* Error messages that should be logged. */
 
@@ -328,7 +315,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
 
 #define MSGBUFSIZ 1024
 
-static void
+void
 do_log(LogLevel level, const char *fmt, va_list args)
 {
        char msgbuf[MSGBUFSIZ];
diff --git a/log.h b/log.h
index 8ab5c0939205d66cd263663998bf6fbe48503570..42a9a6ec743d82923a53973d5b20107e7e10a1ea 100644 (file)
--- a/log.h
+++ b/log.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: log.h,v 1.5 2002/02/04 12:15:25 markus Exp $  */
+/*     $OpenBSD: log.h,v 1.6 2002/02/22 12:20:34 markus Exp $  */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -65,4 +65,6 @@ void     fatal_cleanup(void);
 void     fatal_add_cleanup(void (*) (void *), void *);
 void     fatal_remove_cleanup(void (*) (void *), void *);
 
+void    do_log(LogLevel, const char *, va_list);
+
 #endif
index 80eab26927f734240bbfe6d8034a271ac46242d5..88f10ebec76e6537261ef8e6753d47844393e97f 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keyscan.c,v 1.33 2001/12/10 20:34:31 markus Exp $");
+RCSID("$OpenBSD: ssh-keyscan.c,v 1.34 2002/02/22 12:20:34 markus Exp $");
 
 #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
 #include <sys/queue.h>
@@ -660,11 +660,17 @@ do_host(char *host)
        }
 }
 
-static void
-fatal_callback(void *arg)
+void
+fatal(const char *fmt,...)
 {
+       va_list args;
+       va_start(args, fmt);
+       do_log(SYSLOG_LEVEL_FATAL, fmt, args);
+       va_end(args);
        if (nonfatal_fatal)
                longjmp(kexjmp, -1);
+       else
+               fatal_cleanup();
 }
 
 static void
@@ -677,9 +683,9 @@ usage(void)
        fprintf(stderr, "  -p port     Connect to the specified port.\n");
        fprintf(stderr, "  -t keytype  Specify the host key type.\n");
        fprintf(stderr, "  -T timeout  Set connection timeout.\n");
-        fprintf(stderr, "  -v          Verbose; display verbose debugging messages.\n");
-        fprintf(stderr, "  -4          Use IPv4 only.\n");
-        fprintf(stderr, "  -6          Use IPv6 only.\n");
+       fprintf(stderr, "  -v          Verbose; display verbose debugging messages.\n");
+       fprintf(stderr, "  -4          Use IPv4 only.\n");
+       fprintf(stderr, "  -6          Use IPv6 only.\n");
        exit(1);
 }
 
@@ -766,7 +772,6 @@ main(int argc, char **argv)
                usage();
 
        log_init("ssh-keyscan", log_level, SYSLOG_FACILITY_USER, 1);
-       fatal_add_cleanup(fatal_callback, NULL);
 
        maxfd = fdlim_get(1);
        if (maxfd < 0)
This page took 1.086415 seconds and 5 git commands to generate.