https://github.com/python/cpython/commit/f35c7c070ca6b49c5d6a97be34e6c02f828f5873
commit: f35c7c070ca6b49c5d6a97be34e6c02f828f5873
branch: main
author: Malcolm Smith <[email protected]>
committer: erlend-aasland <[email protected]>
date: 2024-02-03T00:30:52+01:00
summary:

gh-114875: Require getgrent for building the grp extension module (#114876)

Co-authored-by: Erlend E. Aasland <[email protected]>

files:
A Misc/NEWS.d/next/Build/2024-02-01-20-08-11.gh-issue-114875.x_2iZ9.rst
M configure
M configure.ac
M pyconfig.h.in

diff --git 
a/Misc/NEWS.d/next/Build/2024-02-01-20-08-11.gh-issue-114875.x_2iZ9.rst 
b/Misc/NEWS.d/next/Build/2024-02-01-20-08-11.gh-issue-114875.x_2iZ9.rst
new file mode 100644
index 00000000000000..20e9d6376b973c
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2024-02-01-20-08-11.gh-issue-114875.x_2iZ9.rst
@@ -0,0 +1 @@
+Add :c:func:`!getgrent` as a prerequisite for building the :mod:`grp` module.
diff --git a/configure b/configure
index 7b2119ff7f4f78..1d41d7ba66470d 100755
--- a/configure
+++ b/configure
@@ -17475,6 +17475,12 @@ if test "x$ac_cv_func_getgid" = xyes
 then :
   printf "%s\n" "#define HAVE_GETGID 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "getgrent" "ac_cv_func_getgrent"
+if test "x$ac_cv_func_getgrent" = xyes
+then :
+  printf "%s\n" "#define HAVE_GETGRENT 1" >>confdefs.h
+
 fi
 ac_fn_c_check_func "$LINENO" "getgrgid" "ac_cv_func_getgrgid"
 if test "x$ac_cv_func_getgrgid" = xyes
@@ -28968,7 +28974,8 @@ then :
 
     if true
 then :
-  if test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes
+  if test "$ac_cv_func_getgrent" = "yes" &&
+   { test "$ac_cv_func_getgrgid" = "yes" || test "$ac_cv_func_getgrgid_r" = 
"yes"; }
 then :
   py_cv_module_grp=yes
 else $as_nop
diff --git a/configure.ac b/configure.ac
index 5bef2351c987e8..b29cd028f8f200 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4787,7 +4787,7 @@ AC_CHECK_FUNCS([ \
   copy_file_range ctermid dup dup3 execv explicit_bzero explicit_memset \
   faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
   fork fork1 fpathconf fstatat ftime ftruncate futimens futimes futimesat \
-  gai_strerror getegid getentropy geteuid getgid getgrgid getgrgid_r \
+  gai_strerror getegid getentropy geteuid getgid getgrent getgrgid getgrgid_r \
   getgrnam_r getgrouplist getgroups gethostname getitimer getloadavg getlogin \
   getpeername getpgid getpid getppid getpriority _getpty \
   getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid 
getspent \
@@ -7313,7 +7313,9 @@ PY_STDLIB_MOD([_socket],
                     -a "$ac_cv_header_netinet_in_h" = "yes"]))
 
 dnl platform specific extensions
-PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o 
"$ac_cv_func_getgrgid_r" = yes])
+PY_STDLIB_MOD([grp], [],
+  [test "$ac_cv_func_getgrent" = "yes" &&
+   { test "$ac_cv_func_getgrgid" = "yes" || test "$ac_cv_func_getgrgid_r" = 
"yes"; }])
 PY_STDLIB_MOD([pwd], [], [test "$ac_cv_func_getpwuid" = yes -o 
"$ac_cv_func_getpwuid_r" = yes])
 PY_STDLIB_MOD([resource], [], [test "$ac_cv_header_sys_resource_h" = yes])
 PY_STDLIB_MOD([_scproxy],
diff --git a/pyconfig.h.in b/pyconfig.h.in
index b22740710bcbee..2b4bb1a2b52866 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -474,6 +474,9 @@
 /* Define to 1 if you have the `getgid' function. */
 #undef HAVE_GETGID
 
+/* Define to 1 if you have the `getgrent' function. */
+#undef HAVE_GETGRENT
+
 /* Define to 1 if you have the `getgrgid' function. */
 #undef HAVE_GETGRGID
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to