[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Tue Jul 13 11:19:02 MDT 2010


The branch, master has been updated
       via  f85167a... s3-winbind: Don't cache queries to builtin and own sam domain.
       via  57ebc8a... s3-winbind: Set status before we leave in some msrpc functions.
      from  5bdb8b4... Revert "Remove the global char *LastDir."

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f85167a161b078b0ffa23598a4a548fb2fd54cbf
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 13 15:37:13 2010 +0200

    s3-winbind: Don't cache queries to builtin and own sam domain.

commit 57ebc8af8061e1a81a46300154ac6c4d489b302a
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jul 7 14:27:04 2010 +0200

    s3-winbind: Set status before we leave in some msrpc functions.

-----------------------------------------------------------------------

Summary of changes:
 source3/winbindd/winbindd_cache.c |   32 +++++++++++++++++++++++++++++---
 source3/winbindd/winbindd_msrpc.c |    4 ++++
 2 files changed, 33 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index a3e202b..631a14d 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -669,6 +669,26 @@ static struct cache_entry *wcache_fetch_raw(char *kstr)
 	return centry;
 }
 
+static bool is_my_own_sam_domain(struct winbindd_domain *domain)
+{
+	if (strequal(domain->name, get_global_sam_name()) &&
+	     sid_equal(&domain->sid, get_global_sam_sid())) {
+		return true;
+	}
+
+	return false;
+}
+
+static bool is_builtin_domain(struct winbindd_domain *domain)
+{
+	if (strequal(domain->name, "BUILTIN") &&
+	    sid_equal(&domain->sid, &global_sid_Builtin)) {
+		return true;
+	}
+
+	return false;
+}
+
 /*
   fetch an entry from the cache, with a varargs key. auto-fetch the sequence
   number and return status
@@ -684,7 +704,9 @@ static struct cache_entry *wcache_fetch(struct winbind_cache *cache,
 	char *kstr;
 	struct cache_entry *centry;
 
-	if (!winbindd_use_cache()) {
+	if (!winbindd_use_cache() ||
+	    is_my_own_sam_domain(domain) ||
+	    is_builtin_domain(domain)) {
 		return NULL;
 	}
 
@@ -4681,7 +4703,9 @@ bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
 	TDB_DATA key, data;
 	bool ret = false;
 
-	if (!wcache_opnum_cacheable(opnum)) {
+	if (!wcache_opnum_cacheable(opnum) ||
+	    is_my_own_sam_domain(domain) ||
+	    is_builtin_domain(domain)) {
 		return false;
 	}
 
@@ -4737,7 +4761,9 @@ void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
 	TDB_DATA key, data;
 	uint32_t dom_seqnum, last_check;
 
-	if (!wcache_opnum_cacheable(opnum)) {
+	if (!wcache_opnum_cacheable(opnum) ||
+	    is_my_own_sam_domain(domain) ||
+	    is_builtin_domain(domain)) {
 		return;
 	}
 
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c
index 780a675..714e657 100644
--- a/source3/winbindd/winbindd_msrpc.c
+++ b/source3/winbindd/winbindd_msrpc.c
@@ -438,6 +438,8 @@ static NTSTATUS msrpc_query_user(struct winbindd_domain *domain,
 	if ( !winbindd_can_contact_domain( domain ) ) {
 		DEBUG(10,("query_user: No incoming trust for domain %s\n",
 			  domain->name));
+		/* Tell the cache manager not to remember this one */
+		status = NT_STATUS_SYNCHRONIZATION_REQUIRED;
 		goto done;
 	}
 
@@ -562,6 +564,8 @@ static NTSTATUS msrpc_lookup_useraliases(struct winbindd_domain *domain,
 	if (!winbindd_can_contact_domain(domain)) {
 		DEBUG(10,("msrpc_lookup_useraliases: No incoming trust for domain %s\n",
 			  domain->name));
+		/* Tell the cache manager not to remember this one */
+		status = NT_STATUS_SYNCHRONIZATION_REQUIRED;
 		goto done;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list