git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] Detect when the passwd struct is missing pw_gecos

From
David Michael <fedora.dm0@gmail.com>
Date
Dec 14, 2012, 19:56 UTC
Message-ID
<CAEvUa7=1Es8LzyHt3XhWJGm+nFum=ggunRCi8hJB9A9nuL5KUg@mail.gmail.com>

NO_GECOS_IN_PWENT was documented with other Makefile variables but was only enforced by manually defining it to the C preprocessor. This adds support for detecting the condition with configure and defining the make variable.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
---
 Makefile     | 3 +++
 configure.ac | 8 ++++++++
 2 files changed, 11 insertions(+)
diff --git a/Makefile b/Makefile
index 8c3a0dd..735a834 100644
--- a/Makefile
+++ b/Makefile
@@ -1657,6 +1657,9 @@ endif
 ifdef NO_D_INO_IN_DIRENT
     BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
 endif
+ifdef NO_GECOS_IN_PWENT
+    BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
+endif
 ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
     BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
 endif
diff --git a/configure.ac b/configure.ac
index 317bfc6..3347c17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -759,6 +759,14 @@ AC_CHECK_MEMBER(struct dirent.d_type,
 [#include <dirent.h>])
 GIT_CONF_SUBST([NO_D_TYPE_IN_DIRENT])
 #
+# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
+# in the C library.
+AC_CHECK_MEMBER(struct passwd.pw_gecos,
+[NO_GECOS_IN_PWENT=],
+[NO_GECOS_IN_PWENT=YesPlease],
+[#include <pwd.h>])
+GIT_CONF_SUBST([NO_GECOS_IN_PWENT])
+#
 # Define NO_SOCKADDR_STORAGE if your platform does not have struct
 # sockaddr_storage.
 AC_CHECK_TYPE(struct sockaddr_storage,
--
1.7.11.7
Message 1 of 1 in “Detect when the passwd struct is missing pw_gecos”
  1. 2/4 Detect when the passwd struct is missing pw_gecosDavid Michael, Dec 14, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.