As of glibc-2.8, struct ucred is guarded by the __USE_GNU #ifdef as you
show below.  You'll need to add -D_GNU_SOURCE to DEFS or CPPFLAGS in
order to build munge-0.5.8 there.  For example:

  CPPFLAGS="-D_GNU_SOURCE" ./configure && make

I'm hoping to release 0.5.9 in the next couple of weeks.  I've already
added the change to have configure set this define.

-Chris


On Wed, 2010-03-03 at 01:14pm PST, "David N. Lombard" wrote:
> 
> I'm having a problem building on F12:
> 
> $ make
> ...
> if gcc -DHAVE_CONFIG_H -I. -I. -I../../config  -I../../src/libcommon 
> -I../../src/libmissing -I../../src/libmunge  -DWITH_PTHREADS  -g -O2 -MT 
> munged-auth_recv.o -MD -MP -MF ".deps/munged-auth_recv.Tpo" -c -o 
> munged-auth_recv.o `test -f 'auth_recv.c' || echo './'`auth_recv.c; \
>         then mv -f ".deps/munged-auth_recv.Tpo" ".deps/munged-auth_recv.Po"; 
> else rm -f ".deps/munged-auth_recv.Tpo"; exit 1; fi
> auth_recv.c: In function ‘auth_recv’:
> auth_recv.c:312: error: storage size of ‘cred’ isn’t known
> make[2]: *** [munged-auth_recv.o] Error 1
> make[2]: Leaving directory 
> `/home/dnlombar/RockCreek/slurm/munge-0.5.8/src/munged'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/dnlombar/RockCreek/slurm/munge-0.5.8/src'
> make: *** [all-recursive] Error 1
> $ 
> 
> The extract from auth_recv.c is:
> 
> 309-int
> 310-auth_recv (m_msg_t m, uid_t *uid, gid_t *gid)
> 311-{
> 312:    struct ucred cred;
> 313-    socklen_t len = sizeof (cred);
> 314-
> 315-    if (getsockopt (m->sd, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0) {
> 316-        log_msg (LOG_ERR, "Unable to get peer identity: %s", strerror 
> (errno));
> 317-        return (-1);
> 
> And here's the definition of 'struct ucred':
> 
> 330-#ifdef __USE_GNU
> 331-/* User visible structure for SCM_CREDENTIALS message */
> 332:struct ucred
> 333-{
> 334-  pid_t pid;                        /* PID of sending process.  */
> 335-  uid_t uid;                        /* UID of sending process.  */
> 336-  gid_t gid;                        /* GID of sending process.  */
> 337-};
> 
> 
> As you can see, __USE_GNU is required for this to be visible.  To
> enable munge to build, I needed to do this:
> 
> $ diff -u munge-0.5.8/configure.orig munge-0.5.8/configure
> --- munge-0.5.8/configure.orig  2006-11-13 16:21:22.000000000 -0800
> +++ munge-0.5.8/configure       2010-03-03 11:43:18.987938959 -0800
> @@ -13122,7 +13122,7 @@
>  }'
>  fi
>  
> -DEFS=-DHAVE_CONFIG_H
> +DEFS="-DHAVE_CONFIG_H -D_GNU_SOURCE"
>  
>  ac_libobjs=
>  ac_ltlibobjs=
> $ 
> 
> Am I missing something here?
> 
> -- 
> David N. Lombard, Intel, Irvine, CA
> I do not speak for Intel Corporation; all comments are strictly my own.

_______________________________________________
munge-users mailing list
[email protected]
https://mail.gna.org/listinfo/munge-users

Reply via email to