diff options
-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 b3684831414..7c17c329379 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 ae8a6846a3e..68aa41f45e7 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 00000000000..f493cbe208f --- /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 + |