From: Björn Baumbach Date: Mon, 30 Dec 2019 15:27:59 +0000 (+0100) Subject: python/samdb: adapt search filter for user object type X-Git-Tag: samba-4.12.0rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45abb4fd4f42db5e71a6e226f1ed5486f3c257db;p=thirdparty%2Fsamba.git python/samdb: adapt search filter for user object type Use a user search filter which is similar to the filter which is used by the basic MS Windows group membership management. The filter filters for objects with the sAMAccountType ATYPE_NORMAL_ACCOUNT. Signed-off-by: Björn Baumbach Reviewed-by: Ralph Boehme --- diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 1230cbb93f4..7852373c817 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -255,8 +255,8 @@ pwdLastSet: 0 filter = "" if 'user' in member_types: - filter += ('(&(sAMAccountName=%s)(objectclass=user))' % - ldb.binary_encode(member)) + filter += ('(&(sAMAccountName=%s)(samAccountType=%d))' % + (ldb.binary_encode(member), dsdb.ATYPE_NORMAL_ACCOUNT)) if 'group' in member_types: filter += ('(&(sAMAccountName=%s)(objectclass=group))' % ldb.binary_encode(member))