[PATCH] Small winbind improvements

Volker Lendecke Volker.Lendecke at SerNet.DE
Sun Aug 6 09:30:25 UTC 2017


Hi!

Review appreciated!

Thanks, Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 7b2d4310024ab11433033c467f62a5c1995dd118 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 1 Aug 2017 15:11:09 +0200
Subject: [PATCH 1/3] winbindd: Make wcache_query_user static

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/winbindd/winbindd_cache.c | 8 ++++----
 source3/winbindd/winbindd_proto.h | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index ce5e5cdfa30..b92eba030ae 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -2223,10 +2223,10 @@ NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
 	return result;
 }
 
-NTSTATUS wcache_query_user(struct winbindd_domain *domain,
-			   TALLOC_CTX *mem_ctx,
-			   const struct dom_sid *user_sid,
-			   struct wbint_userinfo *info)
+static NTSTATUS wcache_query_user(struct winbindd_domain *domain,
+				  TALLOC_CTX *mem_ctx,
+				  const struct dom_sid *user_sid,
+				  struct wbint_userinfo *info)
 {
 	struct winbind_cache *cache = get_cache(domain);
 	struct cache_entry *centry = NULL;
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 6aa0ed99b6b..7560fc53bae 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -148,10 +148,6 @@ void cache_name2sid_trusted(struct winbindd_domain *domain,
 void cache_name2sid(struct winbindd_domain *domain, 
 		    const char *domain_name, const char *name,
 		    enum lsa_SidType type, const struct dom_sid *sid);
-NTSTATUS wcache_query_user(struct winbindd_domain *domain,
-			   TALLOC_CTX *mem_ctx,
-			   const struct dom_sid *user_sid,
-			   struct wbint_userinfo *info);
 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
 				    TALLOC_CTX *mem_ctx,
 				    const struct dom_sid *user_sid,
-- 
2.11.0


From 515fbb9fcd16d7a58fefb05426cc90832e69aa55 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 1 Aug 2017 16:36:27 +0200
Subject: [PATCH 2/3] winbindd: Add debug for ndr cache hit

When looking through winbind debug logs, it's highly confusing if you don't
find a call in the child that's supposed to handle it. Add a debug if the call
was handled from the cache without calling into the child.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/winbindd/winbindd_dual_ndr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/source3/winbindd/winbindd_dual_ndr.c b/source3/winbindd/winbindd_dual_ndr.c
index 250d9d3da59..00c7df1f863 100644
--- a/source3/winbindd/winbindd_dual_ndr.c
+++ b/source3/winbindd/winbindd_dual_ndr.c
@@ -103,6 +103,8 @@ static struct tevent_req *wbint_bh_raw_call_send(TALLOC_CTX *mem_ctx,
 	if ((state->domain != NULL)
 	    && wcache_fetch_ndr(state, state->domain, state->opnum,
 				&state->in_data, &state->out_data)) {
+		DBG_DEBUG("Got opnum %"PRIu32" for domain %s from cache\n",
+			  state->opnum, state->domain->name);
 		tevent_req_done(req);
 		return tevent_req_post(req, ev);
 	}
-- 
2.11.0


From 1e68a65c3d8caeadbcc82bf657420d4cd61e4c0b Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 1 Aug 2017 16:40:01 +0200
Subject: [PATCH 3/3] winbindd: Simplify an if-condition

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/winbindd/winbindd_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index b92eba030ae..93501e4073b 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -4805,7 +4805,7 @@ bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
 		goto fail;
 	}
 
-	if (!is_domain_offline(domain)) {
+	if (is_domain_online(domain)) {
 		uint32_t entry_seqnum, dom_seqnum, last_check;
 		uint64_t entry_timeout;
 
-- 
2.11.0



More information about the samba-technical mailing list