httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Plüm, Rüdiger, VF-Group" <ruediger.pl...@vodafone.com>
Subject RE: initgroups() in mpm_common.c
Date Wed, 16 Mar 2011 07:55:31 GMT
 

> -----Original Message-----
> From: Guenter Knauf 
> Sent: Mittwoch, 16. März 2011 04:23
> To: httpd Developer List
> Subject: initgroups() in mpm_common.c
> 
> 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 ...

I guess we should do that at least for the platforms where we provide the stub
(e.g. _OSD_POSIX). So I am not opposed to the patch above, but I think we should
have a prototype for the platforms where we create the stub.

Regards

Rüdiger

Mime
View raw message