winbindd: prevent log spam when enumerating users
authorRalph Boehme <slow@samba.org>
Tue, 31 May 2016 16:52:12 +0000 (18:52 +0200)
committerUri Simchoni <uri@samba.org>
Thu, 2 Jun 2016 07:04:13 +0000 (09:04 +0200)
When enumerating users we try to fetch sAMAccountType attribute which
might not be present for whatever reason.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Thu Jun  2 09:04:13 CEST 2016 on sn-devel-144

source3/winbindd/winbindd_ads.c

index a9a23db423ba6dc906d769b26cea25d5d9d9675c..dc92a4acc4b44890f1213ac7b31c772a6cb3ecea 100644 (file)
@@ -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;
                }