From e70fef92b2da7593f32c92079b257299bd8fb8b9 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 31 May 2016 18:52:12 +0200 Subject: [PATCH] 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 Reviewed-by: Uri Simchoni Reviewed-by: Michael Adam Autobuild-User(master): Uri Simchoni Autobuild-Date(master): Thu Jun 2 09:04:13 CEST 2016 on sn-devel-144 --- source3/winbindd/winbindd_ads.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index a9a23db423b..dc92a4acc4b 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -343,10 +343,15 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, struct wbint_userinfo *info = &((*pinfo)[count]); uint32_t group; uint32_t atype; + bool ok; - 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.47.3