/* 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 */
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;
return(-1);
init_structs();
+
+ /* don't call winbind for our domain if we are the DC */
+ if (lp_domain_logons()) {
+ winbind_exclude_domain(lp_workgroup());
+ }
#ifdef WITH_PROFILE
if (!profile_setup(False)) {