]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 29 Sep 2021 20:47:58 +0000 (13:47 -0700)
committerGitHub <noreply@github.com>
Wed, 29 Sep 2021 20:47:58 +0000 (13:47 -0700)
Automerge-Triggered-By: GH:benjaminp
(cherry picked from commit 196998e220d6ca030e5a1c8ad63fcaed8e049a98)

Co-authored-by: Geoffrey Thomas <geofft@ldpreload.com>
Include/Python.h
Misc/NEWS.d/next/C API/2021-07-27-17-29-12.bpo-44751.4qmbDG.rst [new file with mode: 0644]
Modules/_cryptmodule.c

index acee38c41539d604102a5fbfb91685598c6e3e2b..6ee52e7492837321c7337e65b4d3e6b943dd1b40 100644 (file)
 #ifndef MS_WINDOWS
 #include <unistd.h>
 #endif
-#ifdef HAVE_CRYPT_H
-#if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE)
-/* Required for glibc to expose the crypt_r() function prototype. */
-#  define _GNU_SOURCE
-#  define _Py_GNU_SOURCE_FOR_CRYPT
-#endif
-#include <crypt.h>
-#ifdef _Py_GNU_SOURCE_FOR_CRYPT
-/* Don't leak the _GNU_SOURCE define to other headers. */
-#  undef _GNU_SOURCE
-#  undef _Py_GNU_SOURCE_FOR_CRYPT
-#endif
-#endif
 
 /* For size_t? */
 #ifdef HAVE_STDDEF_H
diff --git a/Misc/NEWS.d/next/C API/2021-07-27-17-29-12.bpo-44751.4qmbDG.rst b/Misc/NEWS.d/next/C API/2021-07-27-17-29-12.bpo-44751.4qmbDG.rst
new file mode 100644 (file)
index 0000000..d7b9f09
--- /dev/null
@@ -0,0 +1 @@
+Remove ``crypt.h`` include from the public ``Python.h`` header.
index a95f55a63c306e3ab724a35d80294f674226dc16..72a4f44600d92c9c4e58e463196be166b0528c95 100644 (file)
@@ -4,6 +4,9 @@
 #include "Python.h"
 
 #include <sys/types.h>
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
 
 /* Module crypt */