summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-08-23 17:06:49 +1000
committerDamien Miller <djm@mindrot.org>2014-08-23 17:06:49 +1000
commitd244a5816fd1312a33404b436e4dd83594f1119e (patch)
treed7aad1957e8de52b58cc7629535c5ad75ee9c8b4
parent4cec036362a358e398e6a2e6d19d8e5780558634 (diff)
- (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 9478859ad..7a80c2a65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
120140823 120140823
2 - (djm) [sshd.c] Ignore SIGXFSZ in preauth monitor child; can explode on 2 - (djm) [sshd.c] Ignore SIGXFSZ in preauth monitor child; can explode on
3 lastlog writing on platforms with high UIDs; bz#2263 3 lastlog writing on platforms with high UIDs; bz#2263
4 - (djm) [configure.ac] We now require a working vsnprintf everywhere (not
5 just for systems that lack asprintf); check for it always and extend
6 test to catch more brokenness. Fixes builds on Solaris <= 9
4 7
520140822 820140822
6 - (djm) [configure.ac] include leading zero characters in OpenSSL version 9 - (djm) [configure.ac] include leading zero characters in OpenSSL version
diff --git a/configure.ac b/configure.ac
index d93cc6b49..d5b4377b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.581 2014/08/22 08:06:21 djm Exp $ 1# $Id: configure.ac,v 1.582 2014/08/23 07:06:49 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.581 $) 18AC_REVISION($Revision: 1.582 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C]) 20AC_LANG([C])
21 21
@@ -1887,11 +1887,9 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then
1887 ) 1887 )
1888fi 1888fi
1889 1889
1890# If we don't have a working asprintf, then we strongly depend on vsnprintf 1890# We depend on vsnprintf returning the right thing on overflow: the
1891# returning the right thing on overflow: the number of characters it tried to 1891# number of characters it tried to create (as per SUSv3)
1892# create (as per SUSv3) 1892if test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1893if test "x$ac_cv_func_asprintf" != "xyes" && \
1894 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1895 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) 1893 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1896 AC_RUN_IFELSE( 1894 AC_RUN_IFELSE(
1897 [AC_LANG_PROGRAM([[ 1895 [AC_LANG_PROGRAM([[
@@ -1899,15 +1897,23 @@ if test "x$ac_cv_func_asprintf" != "xyes" && \
1899#include <stdio.h> 1897#include <stdio.h>
1900#include <stdarg.h> 1898#include <stdarg.h>
1901 1899
1902int x_snprintf(char *str,size_t count,const char *fmt,...) 1900int x_snprintf(char *str, size_t count, const char *fmt, ...)
1903{ 1901{
1904 size_t ret; va_list ap; 1902 size_t ret;
1905 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap); 1903 va_list ap;
1904
1905 va_start(ap, fmt);
1906 ret = vsnprintf(str, count, fmt, ap);
1907 va_end(ap);
1906 return ret; 1908 return ret;
1907} 1909}
1908 ]], [[ 1910 ]], [[
1909 char x[1]; 1911char x[1];
1910 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1); 1912if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11)
1913 return 1;
1914if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11)
1915 return 1;
1916return 0;
1911 ]])], 1917 ]])],
1912 [AC_MSG_RESULT([yes])], 1918 [AC_MSG_RESULT([yes])],
1913 [ 1919 [