From: Ralph Boehme Date: Tue, 31 May 2016 16:52:12 +0000 (+0200) Subject: winbindd: prevent log spam when enumerating users X-Git-Tag: tdb-1.3.10~1019 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e70fef92b2da7593f32c92079b257299bd8fb8b9;p=thirdparty%2Fsamba.git 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 --- 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; }