httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guenter Knauf <fua...@apache.org>
Subject initgroups() in mpm_common.c
Date Wed, 16 Mar 2011 03:23:21 GMT
Hi all,
I would like to get rid of a missing prototype compiler warning ...
in mpm_common.c we provide an initgroups() for platforms which dont have 
that function. This function just returns 0 for _OSD_POSIX, OS2, WIN32 
and NETWARE. Currently in httpd sources there are only 2 places where 
initgroups() is used: mod_unixd.c and suexec.c; both will not be 
compiled for at least WIN32 and NETWARE, and OS2 does #ifdef the 
initgroups() calls in mod_unixd.c - so only platform where the fake stub 
might be used is _OSD_POSIX (BS2000?).

One possible fix would be to avoid compiling the stub at all:
Index: server/mpm_common.c
===================================================================
--- server/mpm_common.c	(revision 1082026)
+++ server/mpm_common.c	(working copy)
@@ -192,10 +192,11 @@
  }
  #endif

+#if !defined(OS2) && !defined(WIN32) && !defined(NETWARE)
  #ifndef HAVE_INITGROUPS
  int initgroups(const char *name, gid_t basegid)
  {
-#if defined(_OSD_POSIX) || defined(OS2) || defined(WIN32) || 
defined(NETWARE)
+#if defined(_OSD_POSIX)
      return 0;
  #else
      gid_t groups[NGROUPS_MAX];
@@ -222,7 +223,8 @@
      return setgroups(index, groups);
  #endif
  }
-#endif /* def NEED_INITGROUPS */
+#endif /* def HAVE_INITGROUPS */
+#endif

  /* standard mpm configuration handling */
  const char *ap_pid_fname = NULL;

another one would be to add a prototype to mpm_common.h ...

any preferences?

Gün.



Mime
View raw message