The wrapper fun!

Andrew Bartlett abartlet at samba.org
Fri Jun 7 18:03:58 MDT 2013


On Fri, 2013-06-07 at 13:37 +0200, Andreas Schneider wrote:
> On Friday 07 June 2013 21:24:31 Andrew Bartlett wrote:
> > On Fri, 2013-06-07 at 13:19 +0200, Andreas Schneider wrote:
> > > On Friday 07 June 2013 11:14:42 Andreas Schneider wrote:
> > > > Hi list,
> > > > 
> > > > just for your interest, I've made all wrappers LD_PRELOADable.
> > > > 
> > > > http://git.cryptomilk.org/projects/uid_wrapper.git/
> > > > http://git.cryptomilk.org/projects/nss_wrapper.git/
> > > > http://git.cryptomilk.org/projects/socket_wrapper.git/
> > > > 
> > > > They all have a testsuite now. There are still features missing
> > > > (recvmsg()
> > > > in socket_wrapper e.g.) and the testsuites need to be improved too but
> > > > it
> > > > works ...
> > > > 
> > > > I've also have a working syscall() wrapper, w00t!
> > > > 
> > > > 
> > > > I've started to change 'make test' to use uid_wrapper but it doesn't
> > > > really
> > > > work yet.
> > > 
> > > I had a bug in uid_wrapper. It's working!!!!
> > 
> > So now we can either run 'make test' with --enable-selftest and without?
> 
> Now you can run it with optimized binaries.
> 
> > I wouldn't want us to rely on LD_PRELOAD totally (very
> > platform-dependent), but being able to test the binaries that a
> > distribution such as debian or Fedora ship, which shouldn't be compiled
> > with --enable-sefltest is a really big win!
> 
> On which platforms, we support with Samba 4.0 on, does LD_PRELOAD not work?

I don't have a reference, but I always remember being told that was
great for hacks but to be very careful in relying on it. 

While uid_wrapper would never be installed like this, my last encounter
with this being used in 'production' was this:
http://blog.tridgell.net/?p=141

> My patch currently removes it from the samba tree and relies on LD_PRELOAD 
> libraries.

Does that mean users would have to install uid_wrapper et all onto their
systems before they can run Samba's make test, rather than it being
bundled?

My personal preference would be to have this able to do both - that we
LD_PRELOAD if we haven't used the #define based wrappers, ensuring
therefore that we don't loose comparability with systems that define
these functions in terms of macros, or where LD_PRELOAD doesn't work.

(Not that MacOS and Samba get along well these days, but I've always
noticed that everything seems to gain an extra leading _ on that
platform, for example). 

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list