[PATCH] winbindd logging fixes

Ralph Boehme slow at samba.org
Wed Jun 1 09:47:57 UTC 2016


Hi!

Attached are two small fixes for log messages in winbindd.

Please review&push if ok. Thanks!

Cheerio!
-slow
-------------- next part --------------
From 89581b60ceef28b943831a24b589bd5125c4ea9f Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Wed, 3 Feb 2016 08:07:02 +0100
Subject: [PATCH 1/2] winbindd: log domain name of failures to get trustdoms

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/winbindd/winbindd_util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index c323520..f0344b1 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -348,7 +348,8 @@ static void trustdom_list_done(struct tevent_req *req)
 
 	res = wb_domain_request_recv(req, state, &response, &err);
 	if ((res == -1) || (response->result != WINBINDD_OK)) {
-		DBG_WARNING("Could not receive trustdoms\n");
+		DBG_WARNING("Could not receive trusts for domain %s\n",
+			    state->domain->name);
 		TALLOC_FREE(state);
 		return;
 	}
-- 
2.5.0


From c905cb4d8a678eddccbacfb5beb3243f2330cc3d Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Tue, 31 May 2016 18:52:12 +0200
Subject: [PATCH 2/2] winbindd: prevent log spam when enumerating users

When enumerating users we try to fetch sAMAccountType attribute which
might not be present for whatever reason.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/winbindd/winbindd_ads.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index a9a23db..bfd529a 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -344,9 +344,13 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
 		uint32_t group;
 		uint32_t atype;
 
-		if (!ads_pull_uint32(ads, msg, "sAMAccountType", &atype) ||
-		    ds_atype_map(atype) != SID_NAME_USER) {
-			DEBUG(1,("Not a user account? atype=0x%x\n", atype));
+		ok = ads_pull_uint32(ads, msg, "sAMAccountType", &atype);
+		if (!ok) {
+			DBG_INFO("Object lacks sAMAccountType attribute\n");
+			continue;
+		}
+		if (ds_atype_map(atype) != SID_NAME_USER) {
+			DBG_INFO("Not a user account? atype=0x%x\n", atype));
 			continue;
 		}
 
-- 
2.5.0



More information about the samba-technical mailing list