bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. (#5284)

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.
This commit is contained in:
stratakis 2018-01-23 16:11:24 +01:00 committed by Victor Stinner
parent 370d04d1dc
commit e768c86ef4
5 changed files with 10 additions and 2 deletions

View File

@ -35,6 +35,9 @@
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
/* For size_t? */ /* For size_t? */
#ifdef HAVE_STDDEF_H #ifdef HAVE_STDDEF_H

View File

@ -0,0 +1,2 @@
Fix segfault of the crypt module when libxcrypt is provided instead of
libcrypt at the system.

2
configure vendored
View File

@ -7682,7 +7682,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi 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 \ fcntl.h grp.h \
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
sched.h shadow.h signal.h stropts.h termios.h \ sched.h shadow.h signal.h stropts.h termios.h \

View File

@ -2041,7 +2041,7 @@ dnl AC_MSG_RESULT($cpp_type)
# checks for header files # checks for header files
AC_HEADER_STDC 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 \ fcntl.h grp.h \
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
sched.h shadow.h signal.h stropts.h termios.h \ sched.h shadow.h signal.h stropts.h termios.h \

View File

@ -140,6 +140,9 @@
/* Define to 1 if you have the `copysign' function. */ /* Define to 1 if you have the `copysign' function. */
#undef HAVE_COPYSIGN #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. */ /* Define to 1 if you have the `ctermid' function. */
#undef HAVE_CTERMID #undef HAVE_CTERMID