]> andersk Git - openssh.git/commitdiff
- deraadt@cvs.openbsd.org 2006/08/18 09:13:26
authordjm <djm>
Fri, 18 Aug 2006 14:32:20 +0000 (14:32 +0000)
committerdjm <djm>
Fri, 18 Aug 2006 14:32:20 +0000 (14:32 +0000)
     [log.c log.h sshd.c]
     make signal handler termination path shorter; risky code pointed out by
     mark dowd; ok djm markus

ChangeLog
log.c
log.h
sshd.c

index 9fa65236e45e11049a558e813fa505fe5cacdf19..a0dc72852a4c36b02c16371466dff151695e6e45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [sshd.c]
      factor inetd connection, TCP listen and main TCP accept loop out of
      main() into separate functions to improve readability; ok markus@
+   - deraadt@cvs.openbsd.org 2006/08/18 09:13:26
+     [log.c log.h sshd.c]
+     make signal handler termination path shorter; risky code pointed out by
+     mark dowd; ok djm markus
 
 20060817
  - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c]
diff --git a/log.c b/log.c
index 6eac73743327ebda60baf9495ca06c95f4ed9681..32db0cb5f52ddd7ab48493e2ea8ed7f5c8f13e41 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.38 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: log.c,v 1.39 2006/08/18 09:13:25 deraadt Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -137,6 +137,18 @@ error(const char *fmt,...)
        va_end(args);
 }
 
+void
+sigdie(const char *fmt,...)
+{
+       va_list args;
+
+       va_start(args, fmt);
+       do_log(SYSLOG_LEVEL_FATAL, fmt, args);
+       va_end(args);
+       _exit(1);
+}
+
+
 /* Log this message (information that usually should go to the log). */
 
 void
diff --git a/log.h b/log.h
index a8e788a2de2809e104a01c2cce40da4ab4bcb87f..7a8c57079cca6242938bc18ce901143c5996be43 100644 (file)
--- a/log.h
+++ b/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.14 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: log.h,v 1.15 2006/08/18 09:13:25 deraadt Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -53,6 +53,7 @@ LogLevel log_level_number(char *);
 
 void     fatal(const char *, ...) __dead __attribute__((format(printf, 1, 2)));
 void     error(const char *, ...) __attribute__((format(printf, 1, 2)));
+void     sigdie(const char *, ...) __attribute__((format(printf, 1, 2)));
 void     logit(const char *, ...) __attribute__((format(printf, 1, 2)));
 void     verbose(const char *, ...) __attribute__((format(printf, 1, 2)));
 void     debug(const char *, ...) __attribute__((format(printf, 1, 2)));
diff --git a/sshd.c b/sshd.c
index 7065d471b8f55a2370d08da8ca643612fd2022e8..f1f2e38b336dea25b5adfaa4459cfd82eb6c2930 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.345 2006/08/16 11:47:15 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.346 2006/08/18 09:13:26 deraadt Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -344,13 +344,11 @@ main_sigchld_handler(int sig)
 static void
 grace_alarm_handler(int sig)
 {
-       /* XXX no idea how fix this signal handler */
-
        if (use_privsep && pmonitor != NULL && pmonitor->m_pid > 0)
                kill(pmonitor->m_pid, SIGALRM);
 
        /* Log error and exit. */
-       fatal("Timeout before authentication for %s", get_remote_ipaddr());
+       sigdie("Timeout before authentication for %s", get_remote_ipaddr());
 }
 
 /*
This page took 0.200928 seconds and 5 git commands to generate.