libedit-defenses.patch
text/x-patch
Filename: libedit-defenses.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| configure.in | 0 | 0 |
diff --git a/configure.in b/configure.in
index 2dee4b392b18511f18c4e2f49cab482f2ec72dc8..d6968bb9c0a82ab1c509443905fc5f5c1f13deab 100644
*** a/configure.in
--- b/configure.in
*************** PGAC_VAR_INT_TIMEZONE
*** 1202,1207 ****
--- 1202,1214 ----
AC_FUNC_ACCEPT_ARGTYPES
PGAC_FUNC_GETTIMEOFDAY_1ARG
+ # Some versions of libedit contain strlcpy(), setproctitle(), and other
+ # symbols that that library has no business exposing to the world. Pending
+ # acquisition of a clue by those developers, ignore libedit (including its
+ # possible alias of libreadline) while checking for everything else.
+ pgac_save_LIBS="$LIBS"
+ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
+
AC_CHECK_FUNCS([cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat readlink setproctitle setsid sigprocmask symlink sync_file_range towlower utime utimes wcstombs wcstombs_l])
AC_REPLACE_FUNCS(fseeko)
*************** else
*** 1316,1326 ****
AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
fi
- # Some versions of libedit contain strlcpy(); so disregard that library while
- # checking for these standard libc functions.
- pgac_save_LIBS="$LIBS"
- LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
-
AC_REPLACE_FUNCS([crypt fls getopt getrusage inet_aton random rint srandom strerror strlcat strlcpy])
case $host_os in
--- 1323,1328 ----
*************** case $host_os in
*** 1338,1346 ****
;;
esac
-
- LIBS="$pgac_save_LIBS"
-
# System's version of getaddrinfo(), if any, may be used only if we found
# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
# (Note: the AC_REPLACE_FUNCS probe fails on Windows, where the available
--- 1340,1345 ----
*************** else
*** 1394,1406 ****
AC_SUBST(have_win32_dbghelp,no)
fi
- if test "$with_readline" = yes; then
- PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
- AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
- AC_CHECK_FUNCS([append_history history_truncate_file])
- fi
-
-
dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro
dnl (especially on GNU libc)
dnl See also comments in c.h.
--- 1393,1398 ----
*************** if test x"$pgac_cv_gcc_int_atomics" = x"
*** 1451,1456 ****
--- 1443,1457 ----
AC_DEFINE(HAVE_GCC_INT_ATOMICS, 1, [Define to 1 if you have __sync_lock_test_and_set(int *) and friends.])
fi
+ # Lastly, restore full LIBS list and check for readline/libedit symbols
+ LIBS="$pgac_save_LIBS"
+
+ if test "$with_readline" = yes; then
+ PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
+ AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
+ AC_CHECK_FUNCS([append_history history_truncate_file])
+ fi
+
#
# Pthreads