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 3931445ea1b9217b1e892bf6c5e1ecc6edc82359..97f0af55a110350f44774f47331ee489a9d86f40 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 ec6fc483d3900bfc1212264f4f4da578d4b70e05..d8110536b2a32f56b72dd49faf94c301406d94f7 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 df8b55c6139f20fe72c224fc423dfdf22d36d443..8404635b94ddc6731c017dd517da407a267d9afd 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 003f03dac9fbf259923ee996f58185a23e932782..ab46f2a99fe46ba69f8e088e00021d2f31c95bbd 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}
        };