While there are more then 1000 records in the search result from Windows,
a `LDAP_SIZE_LIMIT_EXCEEDED` error will be returned.
Add paged_results control to fix.
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
res = db.search(db.domain_dn(),
scope=ldb.SCOPE_SUBTREE,
+ controls=["paged_results:1:1000"],
attrs=['dn'])
# find a list of dns for each pattern
samdb = context.get_ldap_connection()
dn = context.get_matching_dn(dn_sig)
- samdb.search(dn, scope=int(scope), attrs=attrs.split(','))
+ samdb.search(dn,
+ scope=int(scope),
+ attrs=attrs.split(','),
+ controls=["paged_results:1:1000"])
return True