diff options
Diffstat (limited to 'source3/nsswitch/wb_common.c')
-rw-r--r-- | source3/nsswitch/wb_common.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c index 9bc9faafb5..89dd625241 100644 --- a/source3/nsswitch/wb_common.c +++ b/source3/nsswitch/wb_common.c @@ -28,6 +28,7 @@ /* Global variables. These are effectively the client state information */ int winbindd_fd = -1; /* fd for winbindd socket */ +static char *excluded_domain; /* Free a response structure */ @@ -39,6 +40,16 @@ void free_response(struct winbindd_response *response) SAFE_FREE(response->extra_data); } +/* + smbd needs to be able to exclude lookups for its own domain +*/ +void winbind_exclude_domain(const char *domain) +{ + SAFE_FREE(excluded_domain); + excluded_domain = strdup(domain); +} + + /* Initialise a request structure */ void init_request(struct winbindd_request *request, int request_type) @@ -314,6 +325,12 @@ NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request) return NSS_STATUS_NOTFOUND; } + /* smbd may have excluded this domain */ + if (excluded_domain && + strcasecmp(excluded_domain, request->domain) == 0) { + return NSS_STATUS_NOTFOUND; + } + if (!request) { ZERO_STRUCT(lrequest); request = &lrequest; |