The Wrapper Project

Andreas Schneider asn at
Tue Jul 9 08:35:10 MDT 2013

Hello samba-technical,

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 [1], nss_wrapper [2] and socket_wrapper [3] working as 
libraries you can load into any application using LD_PRELOAD (man 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 [4]. 
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 
to contribute.

Currently the git trees live on my own infrastructure but I'm also happy to 
create git repos on 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 [5] 
and works on MacOSX too.

Best regards,

    -- andreas


Andreas Schneider                   GPG-ID: F33E3FC6
Samba Team                             asn at

More information about the samba-technical mailing list