something looks broken :(

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Tue May 20 21:33:53 UTC 2008


On Tue, 20 May 2008, Denys Vlasenko wrote:

> On Tuesday 20 May 2008 21:59, Cristian Ionescu-Idbohrn wrote:
> > # make clean
> > # make defconfig
> > # make
> >
> >   CC      networking/tcpudp.o
> > In file included from /usr/include/linux/netfilter_ipv4.h:8,
> >                  from networking/tcpudp.c:34:
> > /usr/include/linux/netfilter.h:40: error: expected
> > specifier-qualifier-list before '__u32'
> >
> > This patch seems to help a little:
> >
> > Index: networking/tcpudp.c
> > ===================================================================
> > --- networking/tcpudp.c	(revision 22001)
> > +++ networking/tcpudp.c	(working copy)
> > @@ -31,6 +31,7 @@
> >
> >  #include "libbb.h"
> >  /* Wants <limits.h> etc, thus included after libbb.h: */
> > +#include <linux/types.h>
> >  #include <linux/netfilter_ipv4.h>
>
> My copy of netfilter_ipv4.h does not have such line.
> Can you show the line which fails and its heighborhood?

# cat -n /usr/include/linux/netfilter_ipv4.h|head -n15
     1  #ifndef __LINUX_IP_NETFILTER_H
     2  #define __LINUX_IP_NETFILTER_H
     3
     4  /* IPv4-specific defines for netfilter.
     5   * (C)1998 Rusty Russell -- This code is GPL.
     6   */
     7
     8  #include <linux/netfilter.h>
     9
    10  /* only for userspace compatibility */
    11  /* IP Cache bits. */
    12  /* Src IP address. */
    13  #define NFC_IP_SRC              0x0001
    14  /* Dest IP address. */
    15  #define NFC_IP_DST              0x0002

# cat -n /usr/include/linux/netfilter.h | tail -n20
    28  #define NFC_ALTERED 0x8000
    29
    30  enum nf_inet_hooks {
    31          NF_INET_PRE_ROUTING,
    32          NF_INET_LOCAL_IN,
    33          NF_INET_FORWARD,
    34          NF_INET_LOCAL_OUT,
    35          NF_INET_POST_ROUTING,
    36          NF_INET_NUMHOOKS
    37  };
    38
    39  union nf_inet_addr {
    40          __u32           all[4];
    41          __be32          ip;
    42          __be32          ip6[4];
    43          struct in_addr  in;
    44          struct in6_addr in6;
    45  };
    46
    47  #endif /*__LINUX_NETFILTER_H*/

> >  // TODO: move into this file:
> >
> > and then this:
> >
> > libpwdgrp/lib.a(pwd_grp.o): In function `bb_internal_initgroups':
> > pwd_grp.c:(.text+0xa54): undefined reference to `setgroups'
> > networking/lib.a(httpd.o): In function `httpd_main':
> > httpd.c:(.text+0x3558): undefined reference to `setgroups'
> > networking/lib.a(inetd.o): In function `inetd_main':
> > inetd.c:(.text+0x1738): undefined reference to `setgroups'
> > inetd.c:(.text+0x1eff): undefined reference to `setgroups'
> > runit/lib.a(chpst.o): In function `suidgid':
> > chpst.c:(.text+0x49): undefined reference to `setgroups'
> > /usr/bin/ld: busybox_unstripped: hidden symbol `setgroups' isn't defined
> > /usr/bin/ld: final link failed: Nonrepresentable section on output
>
> Well, setgroups is a pretty standard libc routine.
> Can you send your .config?

As showed in the beginning of the message:

# make clean
# make defconfig

Problem seems to be located in include/grp_.h which redefines the
setgroups prototype (line 42):

    31  /* The group structure.  */
    32  struct group {
    33          char *gr_name;          /* Group name.  */
    34          char *gr_passwd;        /* Password.    */
    35          gid_t gr_gid;           /* Group ID.    */
    36          char **gr_mem;          /* Member list. */
    37  };
    38
    39  /* We don't reimplement this, just supplying prototype */
    40  /* The function itself is in libc */
    41  /* Set the group set for the current user to GROUPS (N of them).  */
    42  extern int setgroups(size_t __n, __const gid_t *__groups);
    43
    44
    45  #define setgrent     bb_internal_setgrent
    46  #define endgrent     bb_internal_endgrent
    47  #define getgrent     bb_internal_getgrent
    48  #define fgetgrent    bb_internal_fgetgrent
    49  #define putgrent     bb_internal_putgrent
    50  #define getgrgid     bb_internal_getgrgid

If I comment out that prototype I get a few warnings, like:

runit/chpst.c: In function 'suidgid':
runit/chpst.c:87: warning: implicit declaration of function 'setgroups'

But linking works fine:

  LINK    busybox_unstripped
Trying libraries: crypt m
 Library crypt is needed
 Library m is needed
Final link with: crypt m


Cheers,

-- 
Cristian



More information about the busybox mailing list