RE: Tproxy patch

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Mon, 17 Jul 2006 11:04:52 +0200

mån 2006-07-17 klockan 16:31 +0800 skrev Steven Wilton:
> > That would be a bit messy. The problem is that those two linux headers
> > isn't supposed to be included at all in userspace applications (only
> > kernel). glibc provides it's own types.
> >
> > I suppose we could use the same glue as Fedora already has in it's
> > sys/capability.h...
> >
> > --- libcap-1.10/libcap/include/sys/capability.h.foo Fri Nov 9
> > 16:26:25 2001
> > +++ libcap-1.10/libcap/include/sys/capability.h Fri Nov 9
> > 16:28:47 2001
> > @@ -21,6 +21,16 @@
> > */
> >
> > #include <sys/types.h>
> > +#include <stdint.h>
> > +
> > +/*
> > + * Make sure we can be included from userland by preventing
> > + * capability.h from including other kernel headers
> > + */
> > +#define _LINUX_TYPES_H
> > +#define _LINUX_FS_H
> > +typedef unsigned int __u32;
> > +
> > #include <linux/capability.h>
> >
> > /*
> >
> >
> > or maybe move all capability related code out to a separate file.
> >
>
> You mean something similar to the attached patch?

Yes, plus the above #define and typedef trickery before including
sys/capability.h to shield us from the linux kernel types..

#define _LINUX_TYPES_H
#define _LINUX_FS_H
typedef uint32_t __u32;
#include <sys/capability.h>

Regards
Henrik

Received on Mon Jul 17 2006 - 03:04:59 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Aug 01 2006 - 12:00:02 MDT