Synced patch for libxcrypt with upstream

This commit is contained in:
Charalampos Stratakis 2018-01-23 17:18:20 +01:00 committed by Iryna Shcherbina
parent d3af3ef92c
commit 10ba826cb6
2 changed files with 20 additions and 37 deletions

View File

@ -1,45 +1,28 @@
From bb9a8332e54fd6d2b0d4767b55c7df9a36ad3022 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sun, 21 Jan 2018 18:55:31 +0100
Subject: [PATCH] cryptmodule: Include <crypt.h> for declaration of crypt() if
needed
Not every target system may provide a crypt() function in its stdlibc
and may use an external or replacement library, like libxcrypt, for
providing such functions.
---
Modules/_cryptmodule.c | 4 ++++
configure.ac | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c
index 58d179e6a3..0031037b64 100644
--- a/Modules/_cryptmodule.c
+++ b/Modules/_cryptmodule.c
@@ -5,6 +5,10 @@
#include <sys/types.h>
+#if defined(HAVE_CRYPT_H)
diff --git a/Include/Python.h b/Include/Python.h
index dd595ea5e4c..1feb1531cc9 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -35,6 +35,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
+
/* Module crypt */
/*[clinic input]
/* For size_t? */
#ifdef HAVE_STDDEF_H
diff --git a/configure.ac b/configure.ac
index 39e2e8e769..79397a7a24 100644
index 03b0f501aff..15ef872a53a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2049,7 +2049,7 @@ AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
@@ -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 \
-unistd.h utime.h \
+unistd.h crypt.h utime.h \
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \
--
2.16.1

View File

@ -378,7 +378,7 @@ Patch289: 00289-fix-nis-compilation.patch
# Not every target system may provide a crypt() function in its stdlibc
# and may use an external or replacement library, like libxcrypt, for
# providing such functions.
# Reported upstream: https://bugs.python.org/issue32635
# Fixed upstream: https://bugs.python.org/issue32635
Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch
# 00291 #