]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-106881: Check for linux/limits.h before including it (#107397) (#107415)
authorjustdan6 <134341009+justdan6@users.noreply.github.com>
Fri, 28 Jul 2023 23:36:54 +0000 (17:36 -0600)
committerGitHub <noreply@github.com>
Fri, 28 Jul 2023 23:36:54 +0000 (23:36 +0000)
* [3.11] gh-106881: Check for linux/limits.h before including it (#107397)

* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit 11c055f5ff1a353de6d2e77f2af24aaa782878ba)

* Fix sphinx-lint error in NEWS entry

Misc/NEWS.d/next/Build/2023-07-28-18-17-33.gh-issue-106881.U3Ezdq.rst [new file with mode: 0644]
Modules/posixmodule.c
configure
configure.ac
pyconfig.h.in

diff --git a/Misc/NEWS.d/next/Build/2023-07-28-18-17-33.gh-issue-106881.U3Ezdq.rst b/Misc/NEWS.d/next/Build/2023-07-28-18-17-33.gh-issue-106881.U3Ezdq.rst
new file mode 100644 (file)
index 0000000..7febf99
--- /dev/null
@@ -0,0 +1 @@
+Check for ``linux/limits.h`` before including it in ``Modules/posixmodule.c``.
index c000a320322875f1cd049c4b92c5ab77e17df963..9d4228896d230e912a1a85ce5b5064a9103b1334 100644 (file)
@@ -280,7 +280,7 @@ corresponding Unix manual entries for more information on calls.");
 #  undef HAVE_SCHED_SETAFFINITY
 #endif
 
-#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
+#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
 #  define USE_XATTRS
 #  include <linux/limits.h>  // Needed for XATTR_SIZE_MAX on musl libc.
 #endif
index d686e09d81c2dd9d8a26281e82fa0892389ee1ac..af4a5bbfdfa1a4cc8069f67f4e4fe20a35fd27ee 100755 (executable)
--- a/configure
+++ b/configure
@@ -9191,7 +9191,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
 # checks for header files
 for ac_header in  \
   alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
-  ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h \
+  ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/limits.h linux/memfd.h \
   linux/random.h linux/soundcard.h \
   linux/tipc.h linux/wait.h netdb.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
   sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
index 35026f7a2369a77fefa07aa72ae5ff0c1a8735cc..e1cbb7c7fbe9d94d72ac9ce001f284ba5d0a7dcd 100644 (file)
@@ -2668,7 +2668,7 @@ AC_DEFINE(STDC_HEADERS, 1, [Define to 1 if you have the ANSI C header files.])
 # checks for header files
 AC_CHECK_HEADERS([ \
   alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
-  ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h \
+  ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/limits.h linux/memfd.h \
   linux/random.h linux/soundcard.h \
   linux/tipc.h linux/wait.h netdb.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
   sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
index 75f1d90e9bd376985e04e64d4d1126516f69f203..0536047f573ce651876829bcf3b1b8908043edac 100644 (file)
 /* Define if compiling using Linux 4.1 or later. */
 #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS
 
+/* Define to 1 if you have the <linux/limits.h> header file. */
+#undef HAVE_LINUX_LIMITS_H
+
 /* Define to 1 if you have the <linux/memfd.h> header file. */
 #undef HAVE_LINUX_MEMFD_H