LDAP:ldap.SIZELIMIT_EXCEEDED [英] LDAP: ldap.SIZELIMIT_EXCEEDED

查看:692
本文介绍了LDAP:ldap.SIZELIMIT_EXCEEDED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行此代码时出现ldap.SIZELIMIT_EXCEEDED错误:

I am getting an ldap.SIZELIMIT_EXCEEDED error when I run this code:

import ldap

url = 'ldap://<domain>:389'
binddn = 'cn=<username> readonly,cn=users,dc=tnc,dc=org'
password = '<password>'

conn = ldap.initialize(url)
conn.simple_bind_s(binddn,password)

base_dn = "ou=People,dc=tnc,dc=org"
filter = '(objectClass=*)'
attrs = ['sn']

conn.search_s( base_dn, ldap.SCOPE_SUBTREE, filter, attrs )

我的真实用户名,真实密码和真实域在哪里?

Where is my actual username, my actual password, and the actual domain.

我不明白为什么会这样.有人可以照亮吗?

I don't understand why this is. Can somebody shed some light?

谢谢! :) 埃里克

推荐答案

手册: http://www.python-ldap.org/doc/html/ldap.html

例外 ldap. SIZELIMIT_EXCEEDED
超过了LDAP大小限制.这 可能是由于sizelimit LDAP服务器上进行配置.

exception ldap.SIZELIMIT_EXCEEDED
An LDAP size limit was exceeded. This could be due to a sizelimit configuration on the LDAP server.

我认为您最好的选择是限制从服务器收到的邮件中的sizelimit.您可以通过设置属性LDAPObject.sizelimit(不建议使用)或在使用search_ext()

I think your best bet here is to limit the sizelimit on the message you receive from the server. You can do that by setting the attribute LDAPObject.sizelimit (deprecated) or using the sizelimit parameter when using search_ext()

您还应该确保绑定实际上是成功的...

You should also make sure your bind was actually successful...

这篇关于LDAP:ldap.SIZELIMIT_EXCEEDED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆