From: <pyl...@ne...> - 2009-03-05 13:08:47
|
Michael, I've run into the same problem as Joel on basically an identical setup - CentOS 5.2, openldap 2.3.27-8.el5_2.4, python 2.4.3-21.el5, python-ldap 2.2.0-2.1. This of course being on a 64 bit release of CentOS. I did as you suggested and updated openldap to 2.4.12-1, and python-ldap to 2.3.5-1, but I still received the exact same error. Because you mentioned that you had never tested python-ldap on a 64 bit machine, I duplicated my setup in a VirtualBox VM only using a i686 release of CentOS rather than x64. I ran my python program using the old versions of software ( openldap 2.3.27-8.el5_2.4, python 2.4.3-21.el5, python-ldap 2.2.0-2) and it ran without any problems whatsoever. Any suggestions on how to fix this? Let me know if you need any other info. Dominic ----------------------------- Joel Heenan wrote: > Hi Michael, > > Comments inline: > >> Michael Ströder wrote: >> Joel Heenan wrote: >> >>> File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line >> 78, >>> in encodeControlValue >>> >>> return _ldap.encode_page_control(size,cookie) >>> >>> ldap.ENCODING_ERROR >> It seems you're running on a 64-bit platform. I did never test >> python-ldap on such a system. Which version of python-ldap is it? Did >> you compile it yourself? Which versions of OpenLDAP libs are used? > > I am using 64-bit RPM's compiled by RedHat for RHEL5.2 . The 32-bit > variants are installed I'll see if I can work out how to force it to > use them. > > Here are the versions involved, but be aware RedHat versions include > backporting so it can be difficult to say exactly what is included: > > openldap-2.3.27-8.el5_1.3 > openldap-devel-2.3.27-8.el5_1.3 > python-ldap-2.2.0-2.1 These releases are old: OpenLDAP 2.3.27 was released 2006-08-19 python-ldap 2.2.0 was released 2006-04-10 There have been numerous bug fixes to both packages since then. While I don't have a 64-bit box myself there were several related fixes contributed and tested by others. So I suggest to build recent releases of both from source and test with that. >>> Server is RHEL5.2 >> Hmm, isn't this quite old? I'd guess old versions of python-ldap and >> OpenLDAP are shipped with this release. > > Err RHEL5.2 is the latest stable I believe. Whatever stable means to Red Hat for these particular packages. Sorry, if you insist on using these ancient versions I have to point you to Red Hat's support. Ciao, Michael. |
From: Michael S. <mi...@st...> - 2009-03-05 14:22:39
|
pyl...@ne... wrote: > > I've run into the same problem as Joel on basically an identical setup > - CentOS 5.2, openldap 2.3.27-8.el5_2.4, python 2.4.3-21.el5, > python-ldap 2.2.0-2.1. This of course being on a 64 bit release of > CentOS. > > I did as you suggested and updated openldap to 2.4.12-1, and > python-ldap to 2.3.5-1, but I still received the exact same error. The problem with using binary packages is that I never know whether patches were applied by the distributor and which build parameters were used. Also note there's python-ldap with some minor build fixes and OpenLDAP 2.4.15 with numerous fixes to libldap. OpenLDAP developers will likely not give support with this issue if the problem cannot be reproduced with recent code. > Because you mentioned that you had never tested python-ldap on a 64 > bit machine, I duplicated my setup in a VirtualBox VM only using a > i686 release of CentOS rather than x64. > > I ran my python program using the old versions of software ( openldap > 2.3.27-8.el5_2.4, python 2.4.3-21.el5, python-ldap 2.2.0-2) and it ran > without any problems whatsoever. Thanks for testing this. > Any suggestions on how to fix this? At the moment I have no idea how to proceed. I'd suggest to build from source. Not sure about compiler woes on that platform. E.g. try turning off optimization (with option -O0) when building from source. Ciao, Michael. |
From: <pyl...@ne...> - 2009-03-06 12:53:35
|
Michael, I will try as you suggested and will compile the current versions of openldap, python-ldap, cyrus-sasl, and openssl without any patches and default options. I'll let you know how that turns out. To respond to your point that you don't know what build options are used, or what patches applied to binary distributions, here is what the spec files I used to build openldap and python-ldap contained: python-ldap only had one patch applied to it. I'll paste the patch below, but the patch isn't the problem. I recompiled the python-ldap RPM without any of the patches and ran into the same encoding error. The packages was configured and built using the following two commands: setup.py build setup.py install --skip-build --root $RPM_BUILD_ROOT ($RPM_BUILD_ROOT being /var/tmp/python-ldap-2.3.5-root ) python-ldap-2.2.0-dirs.patch: --- python-ldap-2.3.5/setup.cfg.dirs 2008-07-06 11:04:13.000000000 -0400 +++ python-ldap-2.3.5/setup.cfg 2008-09-03 13:45:20.000000000 -0400 @@ -2,8 +2,7 @@ extra_objects = extra_compile_args = libs = ldap_r lber sasl2 ssl crypto -library_dirs = /usr/local/openldap-2.3/lib -include_dirs = /usr/local/openldap-2.3/include /usr/include/sasl +include_dirs = /usr/include/sasl OpenLDAP was built with considerably more patches and the build process is extremely involved. The following flags are used in building: CFLAGS=" -D_REENTRANT -fPIC -D_GNU_SOURCE" The OpenLDAP package RPM builds its own version of BerkeleyDB which it builds like so: configure -C \ --with-pic \ --disable-static \ --enable-shared \ --with-uniquename=_openldap_slapd_46 \ --prefix=${dbdir} \ --includedir=${dbdir}/include \ --libdir=${dbdir}/%{_lib}${subdir:+/${subdir}} make %{_smp_mflags} libdb_base=libslapd_db libso_base=libslapd_db make install libdb_base=libslapd_db libso_base=libslapd_db strip="false" OpenLDAP is configured and made with the following flags: configure \ --with-threads=posix \ --enable-local --enable-rlookups \ --with-tls \ --with-cyrus-sasl \ --enable-wrappers \ --enable-passwd \ --enable-cleartext \ --enable-crypt \ --enable-spasswd \ --enable-lmpasswd \ --enable-modules \ --disable-sql \ --libexecdir=%{_libdir} \ $@ make %{_smp_mflags} LIBTOOL="$libtool" The openldap clients are build using: build \ --disable-slapd \ --enable-shared \ --enable-dynamic \ --enable-static \ --without-kerberos \ --with-pic If there's any information you need to figure out what's going, let me know and I'll be happy to grab it for you. Dominic On Thu, Mar 5, 2009 at 6:22 AM, Michael Ströder - mi...@st... <+pyldap+dlobue+63e3ab027f.michael#str...@sp...> wrote: > pyl...@ne... wrote: >> >> I've run into the same problem as Joel on basically an identical setup >> - CentOS 5.2, openldap 2.3.27-8.el5_2.4, python 2.4.3-21.el5, >> python-ldap 2.2.0-2.1. This of course being on a 64 bit release of >> CentOS. >> >> I did as you suggested and updated openldap to 2.4.12-1, and >> python-ldap to 2.3.5-1, but I still received the exact same error. > > The problem with using binary packages is that I never know whether > patches were applied by the distributor and which build parameters were > used. > > Also note there's python-ldap with some minor build fixes and OpenLDAP > 2.4.15 with numerous fixes to libldap. OpenLDAP developers will likely > not give support with this issue if the problem cannot be reproduced > with recent code. > >> Because you mentioned that you had never tested python-ldap on a 64 >> bit machine, I duplicated my setup in a VirtualBox VM only using a >> i686 release of CentOS rather than x64. >> >> I ran my python program using the old versions of software ( openldap >> 2.3.27-8.el5_2.4, python 2.4.3-21.el5, python-ldap 2.2.0-2) and it ran >> without any problems whatsoever. > > Thanks for testing this. > >> Any suggestions on how to fix this? > > At the moment I have no idea how to proceed. I'd suggest to build from > source. Not sure about compiler woes on that platform. E.g. try turning > off optimization (with option -O0) when building from source. > > Ciao, Michael. > |
From: Zhang H. <zhb...@gm...> - 2009-03-15 10:50:31
|
I had the same error here while run Demo/page_control.py: ---- Traceback (most recent call last): File "1.py", line 23, in ? serverctrls=[lc] File "/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/ldapobject.py", line 501, in search_ext_s msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit) File "/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/ldapobject.py", line 495, in search_ext EncodeControlTuples(serverctrls), File "/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", line 110, in EncodeControlTuples result = [ File "/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", line 45, in getEncodedTuple return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue)) File "/usr/lib64/python2.4/site-packages/python_ldap-2.3.6-py2.4-linux-x86_64.egg/ldap/controls.py", line 78, in encodeControlValue return _ldap.encode_page_control(size,cookie) ldap.ENCODING_ERROR ---- My env: OS: RHEL 5.3, x86_64 Python: 2.4.3-24.el5 (shipped within RHEL 5.3) python-ldap: 2.3.6 (installed from source tarball) OpenLDAP: 2.3.43-3.el5 (shipped within RHEL 5.3) How can i solve it? -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Zhang H. <zhb...@gm...> - 2009-03-15 13:43:58
|
Strange, the same code (Demo/page_control.py) works in: - OS: CentOS 5.2, *i386* - Python: 2.4.3-21.el5 (shipped within CentOS) - python-ldap: 2.3.6 (installed from source tarball) - OpenLDAP: 2.3.27-8.el5_2.4 -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Zhang H. <zhb...@gm...> - 2009-03-15 14:10:45
|
Zhang Huangbin wrote: > Strange, the same code (Demo/page_control.py) works in: > > - OS: CentOS 5.2, *i386* > - Python: 2.4.3-21.el5 (shipped within CentOS) > - python-ldap: 2.3.6 (installed from source tarball) > - OpenLDAP: 2.3.27-8.el5_2.4 > How can i help developers fix this possible bug? Please feel free to contact me if you need more information. Thanks very much. :P -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-03-16 11:28:38
|
Zhang Huangbin wrote: > Zhang Huangbin wrote: >> Strange, the same code (Demo/page_control.py) works in: >> >> - OS: CentOS 5.2, *i386* >> - Python: 2.4.3-21.el5 (shipped within CentOS) >> - python-ldap: 2.3.6 (installed from source tarball) >> - OpenLDAP: 2.3.27-8.el5_2.4 >> > How can i help developers fix this possible bug? Please feel free to > contact me if you need more information. The problem is that I don't have 64-bit Linux hardware to test myself. And a bug could be in OpenLDAP client libs, Python or python-ldap itself. The OpenLDAP and Python versions mentioned above are indeed quite old. Also I don't know what the distributor CentOS or Red Hat is exactly doing when builing the packages. Dominic tested with a more recent version of the OpenLDAP client libs (2.4.12) but still with pre-installed python 2.4.3-21.el5. Hmm... Ciao, Michael. |
From: Michael S. <mi...@st...> - 2009-03-16 11:36:26
|
Zhang Huangbin wrote: > I had the same error here while run Demo/page_control.py: To all of the people experiencing problems: Could you please run Demo/page_control.py after applying the attached patch (which enables debug logging). To preclude problems in the 64-bit build of OpenLDAP client libs you could also try paged-search with the command-line tool ldapsearch which essentially uses the same control encoding/decoding functions in libldap. Ciao, Michael. Index: Demo/page_control.py =================================================================== RCS file: /cvsroot/python-ldap/python-ldap/Demo/page_control.py,v retrieving revision 1.4 diff -u -r1.4 page_control.py --- Demo/page_control.py 8 Dec 2006 12:38:39 -0000 1.4 +++ Demo/page_control.py 16 Mar 2009 11:33:41 -0000 @@ -6,8 +6,9 @@ import ldap from ldap.controls import SimplePagedResultsControl +ldap.set_option(ldap.OPT_DEBUG_LEVEL,255) ldap.set_option(ldap.OPT_REFERRALS, 0) -l = ldap.initialize(url) +l = ldap.initialize(url,trace_level=2) l.protocol_version = 3 l.simple_bind_s("", "") |
From: Zhang H. <zhb...@gm...> - 2009-03-16 12:01:00
|
Michael Ströder wrote: > To all of the people experiencing problems: > Could you please run Demo/page_control.py after applying the attached > patch (which enables debug logging). > > Index: Demo/page_control.py > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Demo/page_control.py,v > retrieving revision 1.4 > diff -u -r1.4 page_control.py > --- Demo/page_control.py 8 Dec 2006 12:38:39 -0000 1.4 > +++ Demo/page_control.py 16 Mar 2009 11:33:41 -0000 > @@ -6,8 +6,9 @@ > import ldap > from ldap.controls import SimplePagedResultsControl > > +ldap.set_option(ldap.OPT_DEBUG_LEVEL,255) > ldap.set_option(ldap.OPT_REFERRALS, 0) > -l = ldap.initialize(url) > +l = ldap.initialize(url,trace_level=2) > l.protocol_version = 3 > l.simple_bind_s("", "") > > Thanks Michael. :) Here is output msg: ---- $ python page_control.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 0x1671b300 msgid 1 ldap_chkResponseList ld 0x1671b300 msgid 1 all 1 ldap_chkResponseList returns ld 0x1671b300 NULL wait4msg ld 0x1671b300 msgid 1 (infinite timeout) wait4msg continue ld 0x1671b300 msgid 1 all 1 ** ld 0x1671b300 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Mon Mar 16 20:00:35 2009 ** ld 0x1671b300 Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ** ld 0x1671b300 Response Queue: Empty ldap_chkResponseList ld 0x1671b300 msgid 1 all 1 ldap_chkResponseList returns ld 0x1671b300 NULL ldap_int_select read1msg: ld 0x1671b300 msgid 1 all 1 read1msg: ld 0x1671b300 msgid 1 message type bind read1msg: ld 0x1671b300 0 new referrals read1msg: mark request completed, ld 0x1671b300 msgid 1 request done: ld 0x1671b300 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, []) Traceback (most recent call last): File "page_control.py", line 24, in ? serverctrls=[lc] File "/usr/lib64/python2.4/site-packages/ldap/ldapobject.py", line 468, in search_ext EncodeControlTuples(serverctrls), File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 93, in EncodeControlTuples result = [ File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 45, in getEncodedTuple return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue)) File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 78, in encodeControlValue return _ldap.encode_page_control(size,cookie) ldap.ENCODING_ERROR 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/ |
From: Michael S. <mi...@st...> - 2009-03-16 12:13:54
|
Zhang Huangbin wrote: > Michael Ströder wrote: >> To all of the people experiencing problems: >> Could you please run Demo/page_control.py after applying the attached >> patch (which enables debug logging). > > Here is output msg: So this seems to boil down to that the following commands (lines wrapped) would fail at your site instead of returning the encoded control tuple: >>> import ldap >>> from ldap.controls import SimplePagedResultsControl >>> SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple() ('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00') Ciao, Michael. |
From: Zhang H. <zhb...@gm...> - 2009-03-16 12:22:32
|
Michael Ströder wrote: > So this seems to boil down to that the following commands (lines > wrapped) would fail at your site instead of returning the encoded > control tuple: > > >>>> import ldap >>>> from ldap.controls import SimplePagedResultsControl >>>> >>>> > SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple() > ('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00') > Thanks Michael. :) You are right, here is the output: ---- # python Python 2.4.3 (#1, Sep 17 2008, 16:07:08) [GCC 4.1.2 20071124 (Red Hat 4.1.2-41)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ldap >>> ldap.__version__ '2.3.6' >>> from ldap.controls import SimplePagedResultsControl >>> SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple() Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 45, in getEncodedTuple return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue)) File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 78, in encodeControlValue return _ldap.encode_page_control(size,cookie) ldap.ENCODING_ERROR ---- What's the problem? How can i solve it? Thanks very much. :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-03-18 06:02:52
|
Michael Ströder wrote: > Zhang Huangbin wrote: >> Michael Ströder wrote: >>> This patch seems to work (already installed at your site ;-). >>> >> Something strange. >> >> The server your tested is CentOS 5.2 x86_64, and it works with your >> patched version. >> >> But on RHEL 5.3 x86_64, it raises ldap.NO_MEMORY error: > > Are you sure that the new version really was installed and gets used? Aargh! My fault. Thanks David. Modules/ldapcontrol.c in CVS HEAD should work now. Ciao, Michael. http://python-ldap.cvs.sourceforge.net/viewvc/python-ldap/python-ldap/Modules/ldapcontrol.c |
From: Zhang H. <zhb...@gm...> - 2009-03-18 06:32:15
|
Michael Ströder wrote: > Aargh! My fault. Thanks David. > Modules/ldapcontrol.c in CVS HEAD should work now. Tested and it *WORKS* now, Thanks David & Michael. :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-03-18 08:21:49
|
Zhang Huangbin wrote: > > A personal question: Cc: to the list since this could be of general interest. > when will you release a new version? It would be no big deal to release a new version tonight if it's important for your project to use a released version with a definite version number you can reference in your docs. I'd like others who reported the problem to confirm that it works for them now. Ciao, Michael. |
From: Michael S. <mi...@st...> - 2009-03-16 12:48:48
|
Michael Ströder wrote: > Zhang Huangbin wrote: >> Michael Ströder wrote: >>> To all of the people experiencing problems: >>> Could you please run Demo/page_control.py after applying the attached >>> patch (which enables debug logging). >> Here is output msg: > > So this seems to boil down to that the following commands (lines > wrapped) would fail at your site instead of returning the encoded > control tuple: > >>>> import ldap >>>> from ldap.controls import SimplePagedResultsControl >>>> > SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple() > ('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00') Could somebody with more knowledge of C programming please review function encode_rfc2696() in Modules/ldapcontrol.c? The following var declaration could be problematic on 64-bit systems: unsigned long size; Another issue could be in decode_rfc2696() (which is not yet reached if encode_rfc2696() fails): unsigned long count; Ciao, Michael. |
From: Zhang H. <zhb...@gm...> - 2009-03-16 13:30:03
|
Michael Ströder wrote: > Could somebody with more knowledge of C programming please review > function encode_rfc2696() in Modules/ldapcontrol.c? > > The following var declaration could be problematic on 64-bit systems: > > unsigned long size; > > Another issue could be in decode_rfc2696() (which is not yet reached if > encode_rfc2696() fails): > > unsigned long count; I asked friend and he suggests me change them to: unsigned long size; => unsigned int size; unsigned long count; => unsigned int count; Re-compile and install, but it raises the same error. -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-03-16 13:45:24
|
Zhang Huangbin wrote: > Michael Ströder wrote: >> Could somebody with more knowledge of C programming please review >> function encode_rfc2696() in Modules/ldapcontrol.c? >> >> The following var declaration could be problematic on 64-bit systems: >> >> unsigned long size; >> >> Another issue could be in decode_rfc2696() (which is not yet reached if >> encode_rfc2696() fails): >> >> unsigned long count; > > I asked friend and he suggests me change them to: > > unsigned long size; => unsigned int size; > unsigned long count; => unsigned int count; > > Re-compile and install, but it raises the same error. I guess both is platform-dependent and hence the error. Do you see any compiler warnings during build of python-ldap? Can you please send the output? Ciao, Michael. |
From: Michael S. <mi...@st...> - 2009-03-16 14:55:31
|
Zhang Huangbin wrote: > Michael Ströder wrote: >> Could somebody with more knowledge of C programming please review >> function encode_rfc2696() in Modules/ldapcontrol.c? >> >> The following var declaration could be problematic on 64-bit systems: >> >> unsigned long size; 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. Ciao, Michael. Index: Modules/ldapcontrol.c =================================================================== RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v retrieving revision 1.9 diff -u -r1.9 ldapcontrol.c --- Modules/ldapcontrol.c 20 Mar 2008 12:24:56 -0000 1.9 +++ Modules/ldapcontrol.c 16 Mar 2009 14:48:49 -0000 @@ -241,13 +241,15 @@ PyObject *res = 0; BerElement *ber = 0; struct berval cookie, *ctrl_val; + Py_ssize_t cookie_len; unsigned long size; ber_tag_t tag; if (!PyArg_ParseTuple(args, "is#:encode_page_control", &size, - &cookie.bv_val, &cookie.bv_len)) { + &cookie.bv_val, &cookie_len)) { goto endlbl; } + cookie.bv_len = (ber_len_t) cookie_len; if (!(ber = ber_alloc_t(LBER_USE_DER))) { LDAPerr(LDAP_NO_MEMORY); |
From: Zhang H. <zhb...@gm...> - 2009-03-16 15:38:46
|
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@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@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/ |
From: Michael S. <mi...@st...> - 2009-03-16 17:30:48
|
Zhang Huangbin wrote: > 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: This patch seems to work (already installed at your site ;-). Ciao, Michael. Index: Modules/ldapcontrol.c =================================================================== RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v retrieving revision 1.10 diff -u -r1.10 ldapcontrol.c --- Modules/ldapcontrol.c 16 Mar 2009 14:54:55 -0000 1.10 +++ Modules/ldapcontrol.c 16 Mar 2009 17:29:04 -0000 @@ -300,11 +300,13 @@ ber_tag_t tag; struct berval *cookiep; unsigned long count; + Py_ssize_t ldctl_value_len; if (!PyArg_ParseTuple(args, "s#:decode_page_control", &ldctl_value.bv_val, &ldctl_value.bv_len)) { goto endlbl; } + ldctl_value.bv_len = (ber_len_t) ldctl_value_len; if (!(ber = ber_init(&ldctl_value))) { LDAPerr(LDAP_NO_MEMORY); |
From: Zhang H. <zhb...@gm...> - 2009-03-16 18:22:54
|
Michael Ströder wrote: > This patch seems to work (already installed at your site ;-). > Ciao, Michael. > > Index: Modules/ldapcontrol.c > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v > retrieving revision 1.10 > diff -u -r1.10 ldapcontrol.c > --- Modules/ldapcontrol.c 16 Mar 2009 14:54:55 -0000 1.10 > +++ Modules/ldapcontrol.c 16 Mar 2009 17:29:04 -0000 > @@ -300,11 +300,13 @@ > ber_tag_t tag; > struct berval *cookiep; > unsigned long count; > + Py_ssize_t ldctl_value_len; > > if (!PyArg_ParseTuple(args, "s#:decode_page_control", > &ldctl_value.bv_val, &ldctl_value.bv_len)) { > goto endlbl; > } > + ldctl_value.bv_len = (ber_len_t) ldctl_value_len; > > if (!(ber = ber_init(&ldctl_value))) { > LDAPerr(LDAP_NO_MEMORY); > > > So great, it works now. Big thanks, Michael. :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Zhang H. <zhb...@gm...> - 2009-03-16 18:35:30
|
Michael Ströder wrote: > This patch seems to work (already installed at your site ;-). > > Ciao, Michael. > > Index: Modules/ldapcontrol.c > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v > retrieving revision 1.10 > diff -u -r1.10 ldapcontrol.c > --- Modules/ldapcontrol.c 16 Mar 2009 14:54:55 -0000 1.10 > +++ Modules/ldapcontrol.c 16 Mar 2009 17:29:04 -0000 > @@ -300,11 +300,13 @@ > ber_tag_t tag; > struct berval *cookiep; > unsigned long count; > + Py_ssize_t ldctl_value_len; > > if (!PyArg_ParseTuple(args, "s#:decode_page_control", > &ldctl_value.bv_val, &ldctl_value.bv_len)) { > goto endlbl; > } > + ldctl_value.bv_len = (ber_len_t) ldctl_value_len; > > if (!(ber = ber_init(&ldctl_value))) { > LDAPerr(LDAP_NO_MEMORY); > > > hi, Michael. I found another problem. Below code works: >>> import ldap >>> from ldap.controls import SimplePagedResultsControl >>> SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple() ('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00') >>> But Demo/page_control.py doesn't work, it raises ldap.NO_MEMORY sometimes, and 'Segmentation fault' too. ---- # 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 0xb1cd7d0 msgid 1 ldap_chkResponseList ld 0xb1cd7d0 msgid 1 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL wait4msg ld 0xb1cd7d0 msgid 1 (infinite timeout) wait4msg continue ld 0xb1cd7d0 msgid 1 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: Empty ldap_chkResponseList ld 0xb1cd7d0 msgid 1 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 1 all 1 read1msg: ld 0xb1cd7d0 msgid 1 message type bind read1msg: ld 0xb1cd7d0 0 new referrals read1msg: mark request completed, ld 0xb1cd7d0 msgid 1 request done: ld 0xb1cd7d0 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 (('domainName=b.cn,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 0xb1cd7d0 msgid 2 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL wait4msg ld 0xb1cd7d0 msgid 2 (infinite timeout) wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: Empty ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-entry adding response ld 0xb1cd7d0 msgid 2 type 100: wait4msg continue ld 0xb1cd7d0 msgid 2 all 1 ** ld 0xb1cd7d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:34:51 2009 ** ld 0xb1cd7d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0xb1cd7d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0xb1cd7d0 msgid 2 all 1 ldap_chkResponseList returns ld 0xb1cd7d0 NULL ldap_int_select read1msg: ld 0xb1cd7d0 msgid 2 all 1 read1msg: ld 0xb1cd7d0 msgid 2 message type search-result read1msg: ld 0xb1cd7d0 0 new referrals read1msg: mark request completed, ld 0xb1cd7d0 msgid 2 request done: ld 0xb1cd7d0 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 0xb1cd7d0 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_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_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_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_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_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_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_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_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_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=1@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['1'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}xMpCOKC5I4INzFCab3WEmw=='], 'accountStatus': ['active'], 'sn': ['1'], 'homeDirectory': ['/home/vmail'], 'mail': ['1@b.cn'], 'mailMessageStore': ['b.cn/1/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['1']}), ('mail=2@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['2'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}yB5yjZ1ML2NvBn+JzBSGLA=='], 'accountStatus': ['active'], 'sn': ['2'], 'homeDirectory': ['/home/vmail'], 'mail': ['2@b.cn'], 'mailMessageStore': ['b.cn/2/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['2']}), ('mail=3@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['3'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}7MvIfktc4v4oMI/Z8qe68w=='], 'accountStatus': ['active'], 'sn': ['3'], 'homeDirectory': ['/home/vmail'], 'mail': ['3@b.cn'], 'mailMessageStore': ['b.cn/3/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['3']}), ('mail=4@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['4'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}qH/2eaLz5x2RgaZ7dUISLA=='], 'accountStatus': ['active'], 'sn': ['4'], 'homeDirectory': ['/home/vmail'], 'mail': ['4@b.cn'], 'mailMessageStore': ['b.cn/4/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['4']}), ('mail=5@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['5'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}5No7f7vOI0XXdysGdKMY1Q=='], 'accountStatus': ['active'], 'sn': ['5'], 'homeDirectory': ['/home/vmail'], 'mail': ['5@b.cn'], 'mailMessageStore': ['b.cn/5/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['5']}), ('mail=6@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['6'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}FnkJHFqID69vteYIfrGy3A=='], 'accountStatus': ['active'], 'sn': ['6'], 'homeDirectory': ['/home/vmail'], 'mail': ['6@b.cn'], 'mailMessageStore': ['b.cn/6/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['6']}), ('mail=7@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['7'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}jxTkX87qFnpaNt7dS+olQw=='], 'accountStatus': ['active'], 'sn': ['7'], 'homeDirectory': ['/home/vmail'], 'mail': ['7@b.cn'], 'mailMessageStore': ['b.cn/7/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['7']}), ('mail=8@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['8'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}yfD4lfuYq5FZ9R/QKX4jbQ=='], 'accountStatus': ['active'], 'sn': ['8'], 'homeDirectory': ['/home/vmail'], 'mail': ['8@b.cn'], 'mailMessageStore': ['b.cn/8/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['8']}), ('mail=9@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['9'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}RcSMzi4tf73qGvxRx8atJg=='], 'accountStatus': ['active'], 'sn': ['9'], 'homeDirectory': ['/home/vmail'], 'mail': ['9@b.cn'], 'mailMessageStore': ['b.cn/9/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['9']}), ('mail=10@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['10'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}09lEaAKkQll1XTjm0WPoIA=='], 'accountStatus': ['active'], 'sn': ['10'], 'homeDirectory': ['/home/vmail'], 'mail': ['10@b.cn'], 'mailMessageStore': ['b.cn/10/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['10']})], 2, [('1.2.840.113556.1.4.319', 0, '0\r\x02\x01\x00\x04\x08.\x02\x00\x00\x00\x00\x00\x00')]) Traceback (most recent call last): File "1.py", line 32, 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 ---- ---- # 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 0x11df67d0 msgid 1 ldap_chkResponseList ld 0x11df67d0 msgid 1 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL wait4msg ld 0x11df67d0 msgid 1 (infinite timeout) wait4msg continue ld 0x11df67d0 msgid 1 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: Empty ldap_chkResponseList ld 0x11df67d0 msgid 1 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 1 all 1 read1msg: ld 0x11df67d0 msgid 1 message type bind read1msg: ld 0x11df67d0 0 new referrals read1msg: mark request completed, ld 0x11df67d0 msgid 1 request done: ld 0x11df67d0 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 (('domainName=b.cn,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 0x11df67d0 msgid 2 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL wait4msg ld 0x11df67d0 msgid 2 (infinite timeout) wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: Empty ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-entry adding response ld 0x11df67d0 msgid 2 type 100: wait4msg continue ld 0x11df67d0 msgid 2 all 1 ** ld 0x11df67d0 Connections: * host: r6 port: 389 (default) refcnt: 2 status: Connected last used: Tue Mar 17 02:35:36 2009 ** ld 0x11df67d0 Outstanding Requests: * msgid 2, origid 2, status InProgress outstanding referrals 0, parent count 0 ** ld 0x11df67d0 Response Queue: * msgid 2, type 100 chained responses: * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 * msgid 2, type 100 ldap_chkResponseList ld 0x11df67d0 msgid 2 all 1 ldap_chkResponseList returns ld 0x11df67d0 NULL ldap_int_select read1msg: ld 0x11df67d0 msgid 2 all 1 read1msg: ld 0x11df67d0 msgid 2 message type search-result read1msg: ld 0x11df67d0 0 new referrals read1msg: mark request completed, ld 0x11df67d0 msgid 2 request done: ld 0x11df67d0 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 0x11df67d0 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_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_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_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_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_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_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_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_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_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=1@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['1'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}xMpCOKC5I4INzFCab3WEmw=='], 'accountStatus': ['active'], 'sn': ['1'], 'homeDirectory': ['/home/vmail'], 'mail': ['1@b.cn'], 'mailMessageStore': ['b.cn/1/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['1']}), ('mail=2@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['2'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}yB5yjZ1ML2NvBn+JzBSGLA=='], 'accountStatus': ['active'], 'sn': ['2'], 'homeDirectory': ['/home/vmail'], 'mail': ['2@b.cn'], 'mailMessageStore': ['b.cn/2/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['2']}), ('mail=3@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['3'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}7MvIfktc4v4oMI/Z8qe68w=='], 'accountStatus': ['active'], 'sn': ['3'], 'homeDirectory': ['/home/vmail'], 'mail': ['3@b.cn'], 'mailMessageStore': ['b.cn/3/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['3']}), ('mail=4@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['4'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}qH/2eaLz5x2RgaZ7dUISLA=='], 'accountStatus': ['active'], 'sn': ['4'], 'homeDirectory': ['/home/vmail'], 'mail': ['4@b.cn'], 'mailMessageStore': ['b.cn/4/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['4']}), ('mail=5@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['5'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}5No7f7vOI0XXdysGdKMY1Q=='], 'accountStatus': ['active'], 'sn': ['5'], 'homeDirectory': ['/home/vmail'], 'mail': ['5@b.cn'], 'mailMessageStore': ['b.cn/5/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['5']}), ('mail=6@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['6'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}FnkJHFqID69vteYIfrGy3A=='], 'accountStatus': ['active'], 'sn': ['6'], 'homeDirectory': ['/home/vmail'], 'mail': ['6@b.cn'], 'mailMessageStore': ['b.cn/6/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['6']}), ('mail=7@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['7'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}jxTkX87qFnpaNt7dS+olQw=='], 'accountStatus': ['active'], 'sn': ['7'], 'homeDirectory': ['/home/vmail'], 'mail': ['7@b.cn'], 'mailMessageStore': ['b.cn/7/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['7']}), ('mail=8@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['8'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}yfD4lfuYq5FZ9R/QKX4jbQ=='], 'accountStatus': ['active'], 'sn': ['8'], 'homeDirectory': ['/home/vmail'], 'mail': ['8@b.cn'], 'mailMessageStore': ['b.cn/8/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['8']}), ('mail=9@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['9'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}RcSMzi4tf73qGvxRx8atJg=='], 'accountStatus': ['active'], 'sn': ['9'], 'homeDirectory': ['/home/vmail'], 'mail': ['9@b.cn'], 'mailMessageStore': ['b.cn/9/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['9']}), ('mail=10@b.cn,ou=Users,domainName=b.cn,o=domains,dc=iredmail,dc=org', {'cn': ['10'], 'mailQuota': ['104857600'], 'objectClass': ['inetOrgPerson', 'mailUser', 'top'], 'userPassword': ['{MD5}09lEaAKkQll1XTjm0WPoIA=='], 'accountStatus': ['active'], 'sn': ['10'], 'homeDirectory': ['/home/vmail'], 'mail': ['10@b.cn'], 'mailMessageStore': ['b.cn/10/'], 'enabledService': ['mail', 'imap', 'pop3', 'smtp', 'deliver'], 'uid': ['10']})], 2, [('1.2.840.113556.1.4.319', 0, '0\r\x02\x01\x00\x04\x08.\x02\x00\x00\x00\x00\x00\x00')]) Segmentation fault ---- -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Zhang H. <zhb...@gm...> - 2009-03-17 03:22:38
|
Michael Ströder wrote: > This patch seems to work (already installed at your site ;-). > > Ciao, Michael. > > Index: Modules/ldapcontrol.c > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v > retrieving revision 1.10 > diff -u -r1.10 ldapcontrol.c > --- Modules/ldapcontrol.c 16 Mar 2009 14:54:55 -0000 1.10 > +++ Modules/ldapcontrol.c 16 Mar 2009 17:29:04 -0000 > @@ -300,11 +300,13 @@ > ber_tag_t tag; > struct berval *cookiep; > unsigned long count; > + Py_ssize_t ldctl_value_len; > > if (!PyArg_ParseTuple(args, "s#:decode_page_control", > &ldctl_value.bv_val, &ldctl_value.bv_len)) { > goto endlbl; > } > + ldctl_value.bv_len = (ber_len_t) ldctl_value_len; > > if (!(ber = ber_init(&ldctl_value))) { > LDAPerr(LDAP_NO_MEMORY); > > Hi, Michael. Something strange. The server your tested is CentOS 5.2 x86_64, and it works with your patched version. But on RHEL 5.3 x86_64, it raises ldap.NO_MEMORY error: ---- # python 1.py Getting page 1 Traceback (most recent call last): File "1.py", line 30, in ? rtype, rdata, rmsgid, serverctrls = l.result3(msgid) File "/usr/lib64/python2.4/site-packages/ldap/ldapobject.py", line 443, in result3 decoded_serverctrls = DecodeControlTuples(serverctrls) File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 122, in DecodeControlTuples return [ File "/usr/lib64/python2.4/site-packages/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/ldap/controls.py", line 33, in __init__ self.controlValue = controlValue or self.decodeControlValue(encodedControlValue) File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 81, in decodeControlValue size,cookie = _ldap.decode_page_control(encodedValue) ldap.NO_MEMORY ---- But i don't have a public RHEL 5.3 x86_64 server. :( -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-03-17 12:38:27
|
Zhang Huangbin wrote: > Michael Ströder wrote: >> This patch seems to work (already installed at your site ;-). >> > Something strange. > > The server your tested is CentOS 5.2 x86_64, and it works with your > patched version. > > But on RHEL 5.3 x86_64, it raises ldap.NO_MEMORY error: Are you sure that the new version really was installed and gets used? I'm asking since I also made a mistake regarding this during testing. You might wanna check with python -v which modules get loaded and check the file timestamp of the _ldap.so file. Ciao, Michael. |