Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f1d37a9

Browse files
committed
Cope with ERR_set_mark() and ERR_pop_to_mark() not existing in older
OpenSSL libraries --- just don't call them if they're not there. This might possibly lead to misleading error messages, but we'll just have to live with that.
1 parent eb9f280 commit f1d37a9

File tree

4 files changed

+114
-2
lines changed

4 files changed

+114
-2
lines changed

configure

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11039,6 +11039,108 @@ echo "$as_me: error: header file <openssl/err.h> is required for OpenSSL" >&2;}
1103911039
fi
1104011040

1104111041

11042+
11043+
for ac_func in ERR_set_mark
11044+
do
11045+
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
11046+
echo "$as_me:$LINENO: checking for $ac_func" >&5
11047+
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
11048+
if eval "test \"\${$as_ac_var+set}\" = set"; then
11049+
echo $ECHO_N "(cached) $ECHO_C" >&6
11050+
else
11051+
cat >conftest.$ac_ext <<_ACEOF
11052+
/* confdefs.h. */
11053+
_ACEOF
11054+
cat confdefs.h >>conftest.$ac_ext
11055+
cat >>conftest.$ac_ext <<_ACEOF
11056+
/* end confdefs.h. */
11057+
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
11058+
For example, HP-UX 11i <limits.h> declares gettimeofday. */
11059+
#define $ac_func innocuous_$ac_func
11060+
11061+
/* System header to define __stub macros and hopefully few prototypes,
11062+
which can conflict with char $ac_func (); below.
11063+
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
11064+
<limits.h> exists even on freestanding compilers. */
11065+
11066+
#ifdef __STDC__
11067+
# include <limits.h>
11068+
#else
11069+
# include <assert.h>
11070+
#endif
11071+
11072+
#undef $ac_func
11073+
11074+
/* Override any gcc2 internal prototype to avoid an error. */
11075+
#ifdef __cplusplus
11076+
extern "C"
11077+
{
11078+
#endif
11079+
/* We use char because int might match the return type of a gcc2
11080+
builtin and then its argument prototype would still apply. */
11081+
char $ac_func ();
11082+
/* The GNU C library defines this for functions which it implements
11083+
to always fail with ENOSYS. Some functions are actually named
11084+
something starting with __ and the normal name is an alias. */
11085+
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11086+
choke me
11087+
#else
11088+
char (*f) () = $ac_func;
11089+
#endif
11090+
#ifdef __cplusplus
11091+
}
11092+
#endif
11093+
11094+
int
11095+
main ()
11096+
{
11097+
return f != $ac_func;
11098+
;
11099+
return 0;
11100+
}
11101+
_ACEOF
11102+
rm -f conftest.$ac_objext conftest$ac_exeext
11103+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11104+
(eval $ac_link) 2>conftest.er1
11105+
ac_status=$?
11106+
grep -v '^ *+' conftest.er1 >conftest.err
11107+
rm -f conftest.er1
11108+
cat conftest.err >&5
11109+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
11110+
(exit $ac_status); } &&
11111+
{ ac_try='test -z "$ac_c_werror_flag"
11112+
|| test ! -s conftest.err'
11113+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11114+
(eval $ac_try) 2>&5
11115+
ac_status=$?
11116+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
11117+
(exit $ac_status); }; } &&
11118+
{ ac_try='test -s conftest$ac_exeext'
11119+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11120+
(eval $ac_try) 2>&5
11121+
ac_status=$?
11122+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
11123+
(exit $ac_status); }; }; then
11124+
eval "$as_ac_var=yes"
11125+
else
11126+
echo "$as_me: failed program was:" >&5
11127+
sed 's/^/| /' conftest.$ac_ext >&5
11128+
11129+
eval "$as_ac_var=no"
11130+
fi
11131+
rm -f conftest.err conftest.$ac_objext \
11132+
conftest$ac_exeext conftest.$ac_ext
11133+
fi
11134+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
11135+
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
11136+
if test `eval echo '${'$as_ac_var'}'` = yes; then
11137+
cat >>confdefs.h <<_ACEOF
11138+
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
11139+
_ACEOF
11140+
11141+
fi
11142+
done
11143+
1104211144
fi
1104311145

1104411146
if test "$with_pam" = yes ; then

configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.527 2007/09/21 02:33:46 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.528 2007/10/02 00:25:20 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -865,6 +865,7 @@ fi
865865
if test "$with_openssl" = yes ; then
866866
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR([header file <openssl/ssl.h> is required for OpenSSL])])
867867
AC_CHECK_HEADER(openssl/err.h, [], [AC_MSG_ERROR([header file <openssl/err.h> is required for OpenSSL])])
868+
AC_CHECK_FUNCS([ERR_set_mark])
868869
fi
869870

870871
if test "$with_pam" = yes ; then

src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
/* Define to 1 if you have the <editline/readline.h> header file. */
119119
#undef HAVE_EDITLINE_READLINE_H
120120

121+
/* Define to 1 if you have the `ERR_set_mark' function. */
122+
#undef HAVE_ERR_SET_MARK
123+
121124
/* Define to 1 if you have the `fcvt' function. */
122125
#undef HAVE_FCVT
123126

src/interfaces/libpq/fe-secure.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.95 2007/10/01 20:30:06 mha Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.96 2007/10/02 00:25:20 tgl Exp $
1515
*
1616
* NOTES
1717
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -136,6 +136,12 @@
136136
#define ROOT_CRL_FILE "root.crl"
137137
#endif
138138

139+
#ifndef HAVE_ERR_SET_MARK
140+
/* These don't exist in OpenSSL before 0.9.8 */
141+
#define ERR_set_mark() ((void) 0)
142+
#define ERR_pop_to_mark() ((void) 0)
143+
#endif
144+
139145
#ifdef NOT_USED
140146
static int verify_peer(PGconn *);
141147
#endif

0 commit comments

Comments
 (0)