]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. (GH-5284...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 24 Jan 2018 10:11:16 +0000 (02:11 -0800)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 24 Jan 2018 10:11:16 +0000 (11:11 +0100)
glibc is deprecating libcrypt in favor of libxcrypt, however python assumes
that crypt.h will always be included. This change makes the header inclusion
explicit when libxcrypt is present on the system.
(cherry picked from commit e768c86ef442ef89004089a8a34ce5909ffb90f2)

Include/Python.h
Misc/NEWS.d/next/Build/2018-01-23-15-33-40.bpo-32635.qHwIZy.rst [new file with mode: 0644]
configure
configure.ac
pyconfig.h.in

index 4c7c9a48c81c2a3345a7168224e3979ddf3ac918..6177bad869c92f9bf8de4f8320f535aa6b756b3f 100644 (file)
@@ -35,6 +35,9 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
 
 /* For size_t? */
 #ifdef HAVE_STDDEF_H
diff --git a/Misc/NEWS.d/next/Build/2018-01-23-15-33-40.bpo-32635.qHwIZy.rst b/Misc/NEWS.d/next/Build/2018-01-23-15-33-40.bpo-32635.qHwIZy.rst
new file mode 100644 (file)
index 0000000..d411890
--- /dev/null
@@ -0,0 +1,2 @@
+Fix segfault of the crypt module when libxcrypt is provided instead of
+libcrypt at the system.
index ea1baef55d3035259760bb0fd17bed083fa61903..1e66117fffbb7e421d4c2660844d9459dd1f7df6 100755 (executable)
--- a/configure
+++ b/configure
@@ -7809,7 +7809,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
-for ac_header in asm/types.h conio.h direct.h dlfcn.h errno.h \
+for ac_header in asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
 sched.h shadow.h signal.h stropts.h termios.h \
index fc1dba6b029158a9e9c89417c38e40b77e210ee1..2eb511bf7f1f702264fcd2760af18a21197f73c2 100644 (file)
@@ -2055,7 +2055,7 @@ dnl AC_MSG_RESULT($cpp_type)
 
 # checks for header files
 AC_HEADER_STDC
-AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
+AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
 sched.h shadow.h signal.h stropts.h termios.h \
index bc2693b0b2148dd4c8371607a4314de2d7e75742..6cef7b37b7b6ca0c937b1254aaf8b7321355af72 100644 (file)
 /* Define to 1 if you have the `copysign' function. */
 #undef HAVE_COPYSIGN
 
+/* Define to 1 if you have the <crypt.h> header file. */
+#undef HAVE_CRYPT_H
+
 /* Define to 1 if you have the `ctermid' function. */
 #undef HAVE_CTERMID