selftest: Always build a linux-style nss_winbind for nss_wrapper
authorAndrew Bartlett <abartlet@samba.org>
Wed, 3 Oct 2012 06:36:34 +0000 (16:36 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Oct 2012 12:25:57 +0000 (14:25 +0200)
nsswitch/wscript_build
selftest/target/Samba.pm
selftest/target/Samba3.pm
selftest/target/Samba4.pm

index 3931445..97f0af5 100644 (file)
@@ -14,6 +14,15 @@ bld.SAMBA_BINARY('nsstest',
        deps='replace dl'
        )
 
+# The nss_wrapper code relies strictly on the linux implementation and
+# name, so compile but do not install a copy under this name.
+bld.SAMBA_LIBRARY('nss_wrapper_winbind',
+                 source='winbind_nss_linux.c',
+                 deps='winbind-client',
+                 realname='libnss_wrapper_winbind.so.2',
+                 install=False,
+                 vnum='2')
+
 if Utils.unversioned_sys_platform() == 'linux':
        bld.SAMBA_LIBRARY('nss_winbind',
                source='winbind_nss_linux.c',
index ec6fc48..d811053 100644 (file)
@@ -64,6 +64,15 @@ sub bindir_path($$) {
        return $path;
 }
 
+sub nss_wrapper_winbind_so_path($) {
+        my ($object) = @_;
+       my $ret = $ENV{NSS_WRAPPER_WINBIND_SO_PATH};
+        if (not defined($ret)) {
+           $ret = bindir_path($object, "default/nsswitch/libnss-winbind.so");
+       }
+       return $ret;
+}
+
 sub mk_krb5_conf($$)
 {
        my ($ctx, $other_realms_stanza) = @_;
index df8b55c..8404635 100755 (executable)
@@ -1097,10 +1097,7 @@ domusers:X:$gid_domusers:
        $ret{SOCKET_WRAPPER_DEFAULT_IFACE} = $swiface;
        $ret{NSS_WRAPPER_PASSWD} = $nss_wrapper_passwd;
        $ret{NSS_WRAPPER_GROUP} = $nss_wrapper_group;
-       $ret{NSS_WRAPPER_WINBIND_SO_PATH} = $ENV{NSS_WRAPPER_WINBIND_SO_PATH};
-        if (not defined($ret{NSS_WRAPPER_WINBIND_SO_PATH})) {
-               $ret{NSS_WRAPPER_WINBIND_SO_PATH} = Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so");
-        }
+       $ret{NSS_WRAPPER_WINBIND_SO_PATH} = Samba::nss_wrapper_winbind_so_path($self);
        $ret{LOCAL_PATH} = "$shrdir";
 
        return \%ret;
index 003f03d..ab46f2a 100644 (file)
@@ -682,7 +682,7 @@ nogroup:x:65534:nobody
                SAMBA_TEST_FIFO => "$ctx->{prefix}/samba_test.fifo",
                SAMBA_TEST_LOG => "$ctx->{prefix}/samba_test.log",
                SAMBA_TEST_LOG_POS => 0,
-               NSS_WRAPPER_WINBIND_SO_PATH => Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so"),
+               NSS_WRAPPER_WINBIND_SO_PATH => Samba::nss_wrapper_winbind_so_path($self),
                 LOCAL_PATH => $ctx->{share}
        };