]> andersk Git - openssh.git/commitdiff
- (djm) Disable sigdie() for platforms that cannot safely syslog inside
authordjm <djm>
Fri, 18 Aug 2006 22:38:23 +0000 (22:38 +0000)
committerdjm <djm>
Fri, 18 Aug 2006 22:38:23 +0000 (22:38 +0000)
   a signal handler (basically all of them, excepting OpenBSD);
   ok dtucker@

ChangeLog
configure.ac
defines.h
log.c

index 47da9f6da40f4e4c2752f8d813f9801e9ab928af..ccce575db00de1a2336d29ff4c5156e53339b4fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,9 @@
      [gss-genr.c ssh-gss.h]
      constify host argument to match the rest of the GSSAPI functions and
      unbreak compilation with -Werror
+ - (djm) Disable sigdie() for platforms that cannot safely syslog inside
+   a signal handler (basically all of them, excepting OpenBSD);
+   ok dtucker@
 
 20060817
  - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c]
index 436a4a5d72147d2c406c37eb4743e4902383cd80..85b076e7cd589c8cbf8259b040af7eb99e9cf738 100644 (file)
@@ -402,6 +402,8 @@ mips-sony-bsd|mips-sony-newsos4)
        AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
        AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
        AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way])
+       AC_DEFINE(SYSLOG_R_SAFE_IN_SIGHAND, 1,
+           [syslog_r function is safe to use in in a signal handler])
        ;;
 *-*-solaris*)
        if test "x$withval" != "xno" ; then
index b69e1b488a67e8a6af90eb8b3e51bfaaacb1fd30..5a9755e63adc3dbcd4326d5d749db6bd29753231 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -542,6 +542,11 @@ struct winsize {
 # undef HAVE_UPDWTMPX
 #endif
 
+#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
+    defined(SYSLOG_R_SAFE_IN_SIGHAND)
+# define DO_LOG_SAFE_IN_SIGHAND
+#endif
+
 #if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
 # define memmove(s1, s2, n) bcopy((s2), (s1), (n))
 #endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
diff --git a/log.c b/log.c
index 32db0cb5f52ddd7ab48493e2ea8ed7f5c8f13e41..0ce4d85f7c2772804862a55543d6afc9e144f5c4 100644 (file)
--- a/log.c
+++ b/log.c
@@ -142,9 +142,11 @@ sigdie(const char *fmt,...)
 {
        va_list args;
 
+#ifdef DO_LOG_SAFE_IN_SIGHAND
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_FATAL, fmt, args);
        va_end(args);
+#endif
        _exit(1);
 }
 
This page took 0.279098 seconds and 5 git commands to generate.