diff options
| author | Joe Guo <joeg@catalyst.net.nz> | 2018-04-18 15:36:02 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2018-05-12 02:09:28 +0200 |
| commit | 4d950527f3e68cff7fa7281f3266be0d81cc9bde (patch) | |
| tree | d4b673a1f652fa368ad70b80beb660f5b4a02b22 /python | |
| parent | 2a4261c0527b803173a151bff3b35dbc687db707 (diff) | |
| download | samba-4d950527f3e68cff7fa7281f3266be0d81cc9bde.tar.gz samba-4d950527f3e68cff7fa7281f3266be0d81cc9bde.tar.bz2 samba-4d950527f3e68cff7fa7281f3266be0d81cc9bde.zip | |
traffic: add paged_results control for ldb search
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>
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/emulate/traffic.py | 1 | ||||
| -rw-r--r-- | python/samba/emulate/traffic_packets.py | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index afb57da36f0..ea0529c4cb4 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -343,6 +343,7 @@ class ReplayContext(object): 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 diff --git a/python/samba/emulate/traffic_packets.py b/python/samba/emulate/traffic_packets.py index 688c935cdc0..25a02f63c2b 100644 --- a/python/samba/emulate/traffic_packets.py +++ b/python/samba/emulate/traffic_packets.py @@ -326,7 +326,10 @@ def packet_ldap_3(packet, conversation, context): 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 |
