]> granicus.if.org Git - python/commitdiff
bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. (#5284)
authorstratakis <cstratak@redhat.com>
Tue, 23 Jan 2018 15:11:24 +0000 (16:11 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 23 Jan 2018 15:11:24 +0000 (16: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.

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 dd595ea5e4ca54a239fe5a4f364a72f8e38c8fd4..1feb1531cc94f00dbfede56deff48749670f98c9 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 a9b0ab9646bed04ea6c92d50190bf39a90db14ea..5904b54c3eda80a7595b29f74202f3c08cecde6e 100755 (executable)
--- a/configure
+++ b/configure
@@ -7682,7 +7682,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 03b0f501affa7001069cf6cdb5805f1f9d9999be..15ef872a53af458e77ee4df75a937c9b7c34c23c 100644 (file)
@@ -2041,7 +2041,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 dd7c62bad1bacb69ee048f4d793c5b80233daf52..fd5a0c38d89e4412d3b6c6facaa3aa5192f938ef 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