ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

Zhang Huangbin zhbmaillistonly at gmail.com
Mon Mar 16 16:39:51 CET 2009


Michael Ströder wrote:
> Thanks to Zhang Huangbin for giving me access to his machine for testing.
> So I could track it down. It seems to work with the patch below which I
> committed to CVS HEAD.

Hi, Michael. Thanks for your quick response and hard work :)

But i got new error (ldap.NO_MEMORY) here:
----
$ python 1.py
ldap_create
ldap_url_parse_ext(ldap://r6:389/)
*** ldap://r6:389/ - SimpleLDAPObject.set_option ((17, 3),{})
*** ldap://r6:389/ - SimpleLDAPObject.set_option ((17, 3),{})
*** ldap://r6:389/ - SimpleLDAPObject.simple_bind 
(('cn=Manager,dc=iredmail,dc=org', 'passwd', None, None),{})
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP r6:389
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 192.168.122.6:389
ldap_connect_timeout: fd: 3 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
=> result: 1
*** ldap://r6:389/ - SimpleLDAPObject.result3 ((1, 1, -1),{})
ldap_result ld 0xd271300 msgid 1
ldap_chkResponseList ld 0xd271300 msgid 1 all 1
ldap_chkResponseList returns ld 0xd271300 NULL
wait4msg ld 0xd271300 msgid 1 (infinite timeout)
wait4msg continue ld 0xd271300 msgid 1 all 1
** ld 0xd271300 Connections:
* host: r6  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Mon Mar 16 23:38:48 2009

** ld 0xd271300 Outstanding Requests:
 * msgid 1,  origid 1, status InProgress
   outstanding referrals 0, parent count 0
** ld 0xd271300 Response Queue:
   Empty
ldap_chkResponseList ld 0xd271300 msgid 1 all 1
ldap_chkResponseList returns ld 0xd271300 NULL
ldap_int_select
read1msg: ld 0xd271300 msgid 1 all 1
read1msg: ld 0xd271300 msgid 1 message type bind
read1msg: ld 0xd271300 0 new referrals
read1msg:  mark request completed, ld 0xd271300 msgid 1
request done: ld 0xd271300 msgid 1
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_free_connection 0 1
ldap_free_connection: refcnt 1
ldap_parse_result
ldap_msgfree
=> result: (97, [], 1, [])
*** ldap://r6:389/ - SimpleLDAPObject.search_ext 
(('o=domains,dc=iredmail,dc=org', 2, '(objectClass=mailUser)', None, 0, 
[('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00')], None, -1, 
0),{})
ldap_search_ext
put_filter: "(objectClass=mailUser)"
put_filter: simple
put_simple_filter: "objectClass=mailUser"
ldap_build_search_req ATTRS: *
ldap_send_initial_request
ldap_send_server_request
=> result: 2
Getting page 1
*** ldap://r6:389/ - SimpleLDAPObject.result3 ((2, 1, -1),{})
ldap_result ld 0xd271300 msgid 2
ldap_chkResponseList ld 0xd271300 msgid 2 all 1
ldap_chkResponseList returns ld 0xd271300 NULL
wait4msg ld 0xd271300 msgid 2 (infinite timeout)
wait4msg continue ld 0xd271300 msgid 2 all 1
** ld 0xd271300 Connections:
* host: r6  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Mon Mar 16 23:38:48 2009

** ld 0xd271300 Outstanding Requests:
 * msgid 2,  origid 2, status InProgress
   outstanding referrals 0, parent count 0
** ld 0xd271300 Response Queue:
   Empty
ldap_chkResponseList ld 0xd271300 msgid 2 all 1
ldap_chkResponseList returns ld 0xd271300 NULL
ldap_int_select
read1msg: ld 0xd271300 msgid 2 all 1
read1msg: ld 0xd271300 msgid 2 message type search-entry
wait4msg continue ld 0xd271300 msgid 2 all 1
** ld 0xd271300 Connections:
* host: r6  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Mon Mar 16 23:38:48 2009

** ld 0xd271300 Outstanding Requests:
 * msgid 2,  origid 2, status InProgress
   outstanding referrals 0, parent count 0
** ld 0xd271300 Response Queue:
 * msgid 2,  type 100
ldap_chkResponseList ld 0xd271300 msgid 2 all 1
ldap_chkResponseList returns ld 0xd271300 NULL
ldap_int_select
read1msg: ld 0xd271300 msgid 2 all 1
read1msg: ld 0xd271300 msgid 2 message type search-result
read1msg: ld 0xd271300 0 new referrals
read1msg:  mark request completed, ld 0xd271300 msgid 2
request done: ld 0xd271300 msgid 2
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 2, msgid 2)
ldap_free_connection 0 1
ldap_free_connection: refcnt 1
adding response ld 0xd271300 msgid 2 type 101:
ldap_parse_result
ldap_get_dn
ldap_first_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_get_values_len
ldap_next_attribute
ldap_msgfree
=> result: (101, 
[('mail=www at a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org', 
{'cn': ['www'], 'mailQuota': ['104857600'], 'objectClass': 
['inetOrgPerson', 'mailUser', 'top'], 'userPassword': 
['{MD5}Tq418bNZd6AOvYCGwlnUyQ=='], 'accountStatus': ['active'], 'sn': 
['www'], 'homeDirectory': ['/home/vmail'], 'mail': ['www at a.cn'], 
'mailMessageStore': ['a.cn/w/ww/www/'], 'enabledService': ['mail', 
'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['www']})], 2, 
[('1.2.840.113556.1.4.319', 0, '0\x05\x02\x01\x00\x04\x00')])
Traceback (most recent call last):
  File "1.py", line 31, in ?
    rtype, rdata, rmsgid, serverctrls = l.result3(msgid)
  File 
"/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/ldapobject.py", 
line 443, in result3
    decoded_serverctrls = DecodeControlTuples(serverctrls)
  File 
"/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", 
line 122, in DecodeControlTuples
    return [
  File 
"/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", 
line 74, in __init__
    
LDAPControl.__init__(self,ldap.LDAP_CONTROL_PAGE_OID,criticality,controlValue,encodedControlValue)
  File 
"/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", 
line 33, in __init__
    self.controlValue = controlValue or 
self.decodeControlValue(encodedControlValue)
  File 
"/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", 
line 81, in decodeControlValue
    size,cookie = _ldap.decode_page_control(encodedValue)
ldap.NO_MEMORY
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed
----


-- 
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
  http://code.google.com/p/iredmail/




More information about the python-ldap mailing list