The Wrapper Project
asn at samba.org
Tue Jul 9 08:35:10 MDT 2013
in the Samba project we have some wrapper we link against each executable and
library to be able to run 'make test'. As you might know I've been working to
get uid_wrapper , nss_wrapper  and socket_wrapper  working as
libraries you can load into any application using LD_PRELOAD (man ld.so). If
you can preload one of these libraries you can use it with whatever project
you want and you can create tests with optimized binaries.
To get it working I needed to improve the wrappers and also add new important
features. The biggest feature in nss_wrapper is that it provides name
resolution using its own hosts file now. So you can call getaddrinfo() to
resolve hosts in socket_wrapper. socket_wrapper got a destructor to cleanup
UDP socket files. uid_wrapper still needs work, to make sure that it is thread
On the way to get 'make test' in Samba working I found serveral bugs which I
already sent patches for. The remaining patches are my git repository .
I've changed selftest to write a hosts file for name resolution and changed
waf to look for the preloadable system version of the wrappers.
I have removed nss_wrapper, socket_wrapper and uid_wrapper from the Samba
source code for now. I want to maintain and improve them outside of the Samba
The reason is that there are other users of these wrappers than Samba in the
meantime. Nalin Dahyabhai started to use it for testing MIT Kerberos, we plan
to use it in libssh to test against openSSH's sshd and Red Hat is planning to
use them for FreeIPA too. This way it is easier to move forward and get people
Currently the git trees live on my own infrastructure but I'm also happy to
create git repos on git.samba.org if you prefer that.
Yes, you have to install them first into the system before running them. If
you can't do that you can still set the LD_LIBRARY_PATH to point to a
directory where you have installed them. If you vote against the removal of
them from the Samba tree, then we could just pull the code from time to time
from the other repsositories like we do it with heimdal or subunit. I'm
against this but we have developers which would like to have everthing in the
source tree. Alternatively, we could use git submodules for that.
My work on the wrappers is not finished yet. They still need to be checked on
different platforms and we need more tests to easier verify that they are
working correctly. socket_wrapper is already tested on several platforms 
and works on MacOSX too.
Andreas Schneider GPG-ID: F33E3FC6
Samba Team asn at samba.org
More information about the samba-technical