mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
oauth: Disallow synchronous DNS in libcurl
There is concern that a blocking DNS lookup in libpq could stall a backend process (say, via FDW). Since there's currently no strong evidence that synchronous DNS is a popular option, disallow it entirely rather than warning at configure time. We can revisit if anyone complains. Per query from Andres Freund. Author: Jacob Champion <jacob.champion@enterprisedb.com> Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmoddvq
This commit is contained in:
parent
434dbf6907
commit
d7e40845f9
@ -316,7 +316,7 @@ AC_DEFUN([PGAC_CHECK_LIBCURL],
|
|||||||
[Define to 1 if curl_global_init() is guaranteed to be thread-safe.])
|
[Define to 1 if curl_global_init() is guaranteed to be thread-safe.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Warn if a thread-friendly DNS resolver isn't built.
|
# Fail if a thread-friendly DNS resolver isn't built.
|
||||||
AC_CACHE_CHECK([for curl support for asynchronous DNS], [pgac_cv__libcurl_async_dns],
|
AC_CACHE_CHECK([for curl support for asynchronous DNS], [pgac_cv__libcurl_async_dns],
|
||||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([
|
[AC_RUN_IFELSE([AC_LANG_PROGRAM([
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
@ -332,10 +332,10 @@ AC_DEFUN([PGAC_CHECK_LIBCURL],
|
|||||||
[pgac_cv__libcurl_async_dns=yes],
|
[pgac_cv__libcurl_async_dns=yes],
|
||||||
[pgac_cv__libcurl_async_dns=no],
|
[pgac_cv__libcurl_async_dns=no],
|
||||||
[pgac_cv__libcurl_async_dns=unknown])])
|
[pgac_cv__libcurl_async_dns=unknown])])
|
||||||
if test x"$pgac_cv__libcurl_async_dns" != xyes ; then
|
if test x"$pgac_cv__libcurl_async_dns" = xno ; then
|
||||||
AC_MSG_WARN([
|
AC_MSG_ERROR([
|
||||||
*** The installed version of libcurl does not support asynchronous DNS
|
*** The installed version of libcurl does not support asynchronous DNS
|
||||||
*** lookups. Connection timeouts will not be honored during DNS resolution,
|
*** lookups. Rebuild libcurl with the AsynchDNS feature enabled in order
|
||||||
*** which may lead to hangs in client programs.])
|
*** to use it with libpq.])
|
||||||
fi
|
fi
|
||||||
])# PGAC_CHECK_LIBCURL
|
])# PGAC_CHECK_LIBCURL
|
||||||
|
14
configure
vendored
14
configure
vendored
@ -12493,7 +12493,7 @@ $as_echo "#define HAVE_THREADSAFE_CURL_GLOBAL_INIT 1" >>confdefs.h
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Warn if a thread-friendly DNS resolver isn't built.
|
# Fail if a thread-friendly DNS resolver isn't built.
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl support for asynchronous DNS" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl support for asynchronous DNS" >&5
|
||||||
$as_echo_n "checking for curl support for asynchronous DNS... " >&6; }
|
$as_echo_n "checking for curl support for asynchronous DNS... " >&6; }
|
||||||
if ${pgac_cv__libcurl_async_dns+:} false; then :
|
if ${pgac_cv__libcurl_async_dns+:} false; then :
|
||||||
@ -12535,15 +12535,11 @@ fi
|
|||||||
fi
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__libcurl_async_dns" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__libcurl_async_dns" >&5
|
||||||
$as_echo "$pgac_cv__libcurl_async_dns" >&6; }
|
$as_echo "$pgac_cv__libcurl_async_dns" >&6; }
|
||||||
if test x"$pgac_cv__libcurl_async_dns" != xyes ; then
|
if test x"$pgac_cv__libcurl_async_dns" = xno ; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
|
as_fn_error $? "
|
||||||
*** The installed version of libcurl does not support asynchronous DNS
|
*** The installed version of libcurl does not support asynchronous DNS
|
||||||
*** lookups. Connection timeouts will not be honored during DNS resolution,
|
*** lookups. Rebuild libcurl with the AsynchDNS feature enabled in order
|
||||||
*** which may lead to hangs in client programs." >&5
|
*** to use it with libpq." "$LINENO" 5
|
||||||
$as_echo "$as_me: WARNING:
|
|
||||||
*** The installed version of libcurl does not support asynchronous DNS
|
|
||||||
*** lookups. Connection timeouts will not be honored during DNS resolution,
|
|
||||||
*** which may lead to hangs in client programs." >&2;}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
18
meson.build
18
meson.build
@ -909,9 +909,7 @@ if not libcurlopt.disabled()
|
|||||||
cdata.set('HAVE_THREADSAFE_CURL_GLOBAL_INIT', 1)
|
cdata.set('HAVE_THREADSAFE_CURL_GLOBAL_INIT', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Warn if a thread-friendly DNS resolver isn't built.
|
# Fail if a thread-friendly DNS resolver isn't built.
|
||||||
libcurl_async_dns = false
|
|
||||||
|
|
||||||
if not meson.is_cross_build()
|
if not meson.is_cross_build()
|
||||||
r = cc.run('''
|
r = cc.run('''
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
@ -931,16 +929,12 @@ if not libcurlopt.disabled()
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert(r.compiled())
|
assert(r.compiled())
|
||||||
if r.returncode() == 0
|
if r.returncode() != 0
|
||||||
libcurl_async_dns = true
|
error('''
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if not libcurl_async_dns
|
|
||||||
warning('''
|
|
||||||
*** The installed version of libcurl does not support asynchronous DNS
|
*** The installed version of libcurl does not support asynchronous DNS
|
||||||
*** lookups. Connection timeouts will not be honored during DNS resolution,
|
*** lookups. Rebuild libcurl with the AsynchDNS feature enabled in order
|
||||||
*** which may lead to hangs in client programs.''')
|
*** to use it with libpq.''')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user