summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm <djm>2014-08-23 07:06:49 +0000
committerdjm <djm>2014-08-23 07:06:49 +0000
commita9f94ff95a0184f5d930b84211b75a763bc82963 (patch)
tree8fad092f7e661f78fd367be3a62e196805ad5211
parentfdb01ebc9fcb1a08214b47cde9e1d6266ec83c50 (diff)
downloadopenssh-a9f94ff95a0184f5d930b84211b75a763bc82963.tar.gz
- (djm) [configure.ac] We now require a working vsnprintf everywhere (not
just for systems that lack asprintf); check for it always and extend test to catch more brokenness. Fixes builds on Solaris <= 9
-rw-r--r--ChangeLog3
-rw-r--r--configure.ac30
2 files changed, 21 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 9478859a..7a80c2a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
20140823
- (djm) [sshd.c] Ignore SIGXFSZ in preauth monitor child; can explode on
lastlog writing on platforms with high UIDs; bz#2263
+ - (djm) [configure.ac] We now require a working vsnprintf everywhere (not
+ just for systems that lack asprintf); check for it always and extend
+ test to catch more brokenness. Fixes builds on Solaris <= 9
20140822
- (djm) [configure.ac] include leading zero characters in OpenSSL version
diff --git a/configure.ac b/configure.ac
index d93cc6b4..d5b4377b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.581 2014/08/22 08:06:21 djm Exp $
+# $Id: configure.ac,v 1.582 2014/08/23 07:06:49 djm Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
-AC_REVISION($Revision: 1.581 $)
+AC_REVISION($Revision: 1.582 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C])
@@ -1887,11 +1887,9 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then
)
fi
-# If we don't have a working asprintf, then we strongly depend on vsnprintf
-# returning the right thing on overflow: the number of characters it tried to
-# create (as per SUSv3)
-if test "x$ac_cv_func_asprintf" != "xyes" && \
- test "x$ac_cv_func_vsnprintf" = "xyes" ; then
+# We depend on vsnprintf returning the right thing on overflow: the
+# number of characters it tried to create (as per SUSv3)
+if test "x$ac_cv_func_vsnprintf" = "xyes" ; then
AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
@@ -1899,15 +1897,23 @@ if test "x$ac_cv_func_asprintf" != "xyes" && \
#include <stdio.h>
#include <stdarg.h>
-int x_snprintf(char *str,size_t count,const char *fmt,...)
+int x_snprintf(char *str, size_t count, const char *fmt, ...)
{
- size_t ret; va_list ap;
- va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
+ size_t ret;
+ va_list ap;
+
+ va_start(ap, fmt);
+ ret = vsnprintf(str, count, fmt, ap);
+ va_end(ap);
return ret;
}
]], [[
- char x[1];
- exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
+char x[1];
+if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11)
+ return 1;
+if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11)
+ return 1;
+return 0;
]])],
[AC_MSG_RESULT([yes])],
[