cwrap

Andreas Schneider asn at samba.org
Mon Jan 27 10:48:55 MST 2014


On Sunday 26 January 2014 11:15:58 you wrote:
> Hi Andreas,

Hi Stefan,

> https://git.samba.org/?p=asn/samba.git;a=commitdiff;h=2f8c2ccfa0a0486ef825de
> 2b687986482f4797c1 Using just 'libuid_wrapper.so' works for the system
> provided version?
> 
> If so you can add this in lib/uid_wrapper/wscript
> 
> ...
>   if conf.CHECK_BUNDLED_SYSTEM('uid_wrapper', minversion=VERSION,
> set_target=False):
>       conf.DEFINE('USING_SYSTEM_UID_WRAPPER', 1)
>       libuid_wrapper_so_path = 'libuid_wrapper.so'
>   else:
>       libuid_wrapper_so_path = 'bin/shared/private/libuid_wrapper.so'
> 
>   conf.DEFINE('LIBUID_WRAPPER_SO_PATH', libuid_wrapper_so_path)
> ...

I've added that now. Compiling a working uid_wrapper wasn't easy.

> Do we still nee conf.DEFINE('UID_WRAPPER', 1) ?

selftest/wscript has:

    if (not CONFIG_SET(opt, 'NSS_WRAPPER') or
        not CONFIG_SET(opt, 'UID_WRAPPER') or
        not CONFIG_SET(opt, 'SOCKET_WRAPPER')):
        print("ERROR: You must use --enable-selftest to enable selftest")
        sys.exit(1)

I wanted to still print the error if something went wrong.

> In selftest/wscript we need something like:
> 
>  os.environ['LIBUID_WRAPPER_SO_PATH'] = CONFIG_GET('LIBUID_WRAPPER_SO_PATH')
> 
> And then use $ENV{LIBUID_WRAPPER_SO_PATH} in selftest/selftest.pl.

I've passed it using --uid_wrapper_so_path to selftest now.

https://git.samba.org/?p=asn/samba.git;a=shortlog;h=refs/heads/cwrap

> 
> So Samba will pick up the system version of libuid_wrapper.so if the
> version is
> 
> >= the internal version, otherwise we'll use our own one, correct?
> 
> So we can rely on having the features of our own copy, correct?

Yes, it checks for the version using pkg-config. If the right version is not 
detected it will build the internal version.

As a developer you should use the system version. It is the only way you can 
be sure that socket_wrapper doesn't have bugs while bisecting with git!

> Can we get the fd-passing with inet/inet6 sockets implemented for 1.0.0?

No, I will not get this working in time. The release is Feb 2nd and we found 
some issues we want to fix correctly. We need to cleanup stale fds. It is 
possible that glibc closes sockets internally and then the fd is reused when 
we open a normal file.

The solution is to have a swrap_discard() which is called by open().

> I guess we need to handle it in recvmsg() similar to accept(),
> we just need to check is it's already in our list, if so we just add
> the additional fd to the entry.

First we need a test!


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list