diff options
author | Kai Blin <kai@samba.org> | 2007-07-15 07:51:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:01:06 -0500 |
commit | 40dbe572e5884d123377608f83dbe4bc3054565e (patch) | |
tree | 8c9587e26e5341fa94d0293573f29cf63d602fb5 | |
parent | d9a5e18ce0480bf99191c20a75216abfef10eab3 (diff) | |
download | samba-40dbe572e5884d123377608f83dbe4bc3054565e.tar.gz samba-40dbe572e5884d123377608f83dbe4bc3054565e.tar.bz2 samba-40dbe572e5884d123377608f83dbe4bc3054565e.zip |
r23876: Prepare to run nsstest from make test, just not add it to tests_all.sh yet.
(This used to be commit f45ae8a878c3d34ea2e4e1c7770e57cd96fa845b)
-rw-r--r-- | source4/nsswitch/wb_common.c | 17 | ||||
-rw-r--r-- | source4/nsswitch/winbindd_nss.h | 4 | ||||
-rwxr-xr-x | source4/selftest/test_nss.sh | 11 |
3 files changed, 31 insertions, 1 deletions
diff --git a/source4/nsswitch/wb_common.c b/source4/nsswitch/wb_common.c index b368483141..7c17c32937 100644 --- a/source4/nsswitch/wb_common.c +++ b/source4/nsswitch/wb_common.c @@ -295,6 +295,7 @@ int winbind_open_pipe_sock(void) static pid_t our_pid; struct winbindd_request request; struct winbindd_response response; + const char *winbindd_socket_dir_env; ZERO_STRUCT(request); ZERO_STRUCT(response); @@ -307,7 +308,21 @@ int winbind_open_pipe_sock(void) return winbindd_fd; } - if ((winbindd_fd = winbind_named_pipe_sock(WINBINDD_SOCKET_DIR)) == -1) { +#ifdef DEVELOPER + winbindd_socket_dir_env = getenv(WINBINDD_SOCKET_DIR_ENV); + + if (!winbindd_socket_dir_env) + { + winbindd_socket_dir_env = WINBINDD_SOCKET_DIR; + } +#else + winbindd_socket_dir_env = WINBINDD_SOCKET_DIR; +#endif + + winbindd_fd = winbind_named_pipe_sock(winbindd_socket_dir_env); + + if (winbindd_fd == -1) + { return -1; } diff --git a/source4/nsswitch/winbindd_nss.h b/source4/nsswitch/winbindd_nss.h index ae8a6846a3..68aa41f45e 100644 --- a/source4/nsswitch/winbindd_nss.h +++ b/source4/nsswitch/winbindd_nss.h @@ -40,6 +40,10 @@ #define WINBINDD_DOMAIN_ENV "WINBINDD_DOMAIN" /* Environment variables */ #define WINBINDD_DONT_ENV "_NO_WINBINDD" +#ifdef DEVELOPER +#define WINBINDD_SOCKET_DIR_ENV "WINBINDD_SOCKET_DIR" +#endif + /* Update this when you change the interface. */ #define WINBIND_INTERFACE_VERSION 18 diff --git a/source4/selftest/test_nss.sh b/source4/selftest/test_nss.sh new file mode 100755 index 0000000000..f493cbe208 --- /dev/null +++ b/source4/selftest/test_nss.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +incdir=`dirname $0` +. $incdir/test_functions.sh + +if [ ! -f bin/nsstest ]; then + exit 0 +fi + +plantest "NSS-TEST using winbind" member $VALGRIND bin/nsstest bin/shared/libnss_winbind.so + |