summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wb_common.c27
-rw-r--r--source3/nsswitch/winbind_client.h11
2 files changed, 8 insertions, 30 deletions
diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c
index 49a2935bff..b113fc3336 100644
--- a/source3/nsswitch/wb_common.c
+++ b/source3/nsswitch/wb_common.c
@@ -538,18 +538,6 @@ int winbindd_read_reply(struct winbindd_response *response)
return result1 + result2;
}
-bool winbind_env_set(void)
-{
- char *env;
-
- if ((env=getenv(WINBINDD_DONT_ENV)) != NULL) {
- if(strcmp(env, "1") == 0) {
- return true;
- }
- }
- return false;
-}
-
/*
* send simple types of requests
*/
@@ -663,21 +651,6 @@ NSS_STATUS winbindd_priv_request_response(int req_type,
}
/*************************************************************************
- A couple of simple functions to disable winbindd lookups and re-
- enable them
- ************************************************************************/
-
-bool winbind_off(void)
-{
- return setenv(WINBINDD_DONT_ENV, "1", 1) != -1;
-}
-
-bool winbind_on(void)
-{
- return setenv(WINBINDD_DONT_ENV, "0", 1) != -1;
-}
-
-/*************************************************************************
************************************************************************/
const char *nss_err_str(NSS_STATUS ret)
diff --git a/source3/nsswitch/winbind_client.h b/source3/nsswitch/winbind_client.h
index 2a3956e1fd..757f5869e9 100644
--- a/source3/nsswitch/winbind_client.h
+++ b/source3/nsswitch/winbind_client.h
@@ -14,9 +14,14 @@ NSS_STATUS winbindd_priv_request_response(int req_type,
struct winbindd_response *response);
int winbindd_read_reply(struct winbindd_response *response);
-bool winbind_env_set(void);
-bool winbind_off(void);
-bool winbind_on(void);
+#define winbind_env_set() \
+ (strcmp(getenv(WINBINDD_DONT_ENV)?getenv(WINBINDD_DONT_ENV):"0","1") == 0)
+
+#define winbind_off() \
+ (setenv(WINBINDD_DONT_ENV, "1", 1) == 0)
+
+#define winbind_on() \
+ (setenv(WINBINDD_DONT_ENV, "0", 1) == 0)
int winbind_write_sock(void *buffer, int count, int recursing, int need_priv);
int winbind_read_sock(void *buffer, int count);