summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-10 02:28:17 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-10 02:28:17 +0000
commit6baa40e3fe59a68046d31a93eb154237d7bd0837 (patch)
treeb2126ebc458d6dc4467082f6a9d98c7baa33abac /source3/nsswitch
parent65e373ec07f50037aa687fd6dbe6404cc0173f17 (diff)
downloadsamba-6baa40e3fe59a68046d31a93eb154237d7bd0837.tar.gz
samba-6baa40e3fe59a68046d31a93eb154237d7bd0837.tar.bz2
samba-6baa40e3fe59a68046d31a93eb154237d7bd0837.zip
added winbind_exclude_domain() so smbd can tell the winbind client
code not to do lookups for a particular domain. This allows winbind to operate on a Samba PDC (This used to be commit d472ee3a690fb6db03fd4536e4093a18fc37ddbb)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wb_common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c
index ed0075a358..0ec29aa2d7 100644
--- a/source3/nsswitch/wb_common.c
+++ b/source3/nsswitch/wb_common.c
@@ -29,6 +29,17 @@
/* Global variables. These are effectively the client state information */
static int established_socket = -1; /* fd for winbindd socket */
+static char *excluded_domain;
+
+/*
+ smbd needs to be able to exclude lookups for its own domain
+*/
+void winbind_exclude_domain(const char *domain)
+{
+ if (excluded_domain) free(excluded_domain);
+ excluded_domain = strdup(domain);
+}
+
/* Initialise a request structure */
@@ -321,6 +332,12 @@ NSS_STATUS winbindd_request(int req_type,
return NSS_STATUS_NOTFOUND;
}
+ /* smbd may have excluded this domain */
+ if (excluded_domain &&
+ strcasecmp(excluded_domain, request->domain) == 0) {
+ return NSS_STATUS_NOTFOUND;
+ }
+
if (!response) {
ZERO_STRUCT(lresponse);
response = &lresponse;