From 2145eff91d5b7e16ee486b410181f4b849a3fb9e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 19 Oct 2006 22:34:58 +0000 Subject: r19419: BUG 4109: Patch from Timur Bakeyev. Fix bug causing smbd to turn off winbindd and fail to disable the _NO_WINBIND environment. (This used to be commit a6366b40b3967853c20ca5399021108f09ffd505) --- source3/nsswitch/wb_common.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'source3/nsswitch/wb_common.c') diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c index e665a0ffd5..05238f16fb 100644 --- a/source3/nsswitch/wb_common.c +++ b/source3/nsswitch/wb_common.c @@ -525,15 +525,11 @@ int read_reply(struct winbindd_response *response) NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request) { struct winbindd_request lrequest; - char *env; - int value; - + /* Check for our tricky environment variable */ - if ( (env = getenv(WINBINDD_DONT_ENV)) != NULL ) { - value = atoi(env); - if ( value == 1 ) - return NSS_STATUS_NOTFOUND; + if (winbind_env_set()) { + return NSS_STATUS_NOTFOUND; } if (!request) { @@ -632,3 +628,14 @@ BOOL winbind_on( void ) return putenv(s) != -1; } +BOOL winbind_env_set( void ) +{ + char *env; + + if ((env=getenv(WINBINDD_DONT_ENV)) != NULL) { + if(strequal(env, "1")) { + return True; + } + } + return False; +} -- cgit