Re: Load Balance and Redundant LDAP config

2011-04-01 Thread Michael Ströder
Bob Brandt wrote: I apologize if this is not the right place to ask this question... You're welcome to discuss this here. I am looking to modify my LDAP scripts to be both Redundant and Load Balancing! Although both things are mixed all the time these are two different goals. Right now, I

Mailing list moves now!

2011-04-01 Thread Michael Ströder
HI! This is the last message to the old SF mailing list. Do not reply here! The old mailing list will be shut down now! I'd be happy to see you all on our new mailing list: http://mail.python.org/mailman/listinfo/python-ldap All announcements, discussion and support will be posted there.

Re: python-ldap as replication client

2011-03-23 Thread Michael Ströder
Eric Brunson wrote: The new code works great, thanks so much for the new features. I do have one issue, and maybe I'm just not looking in the correct place. The Sync Info Message returns a syncInfoValue which is a BER encoded ASN.1 CHOICE structure: syncInfoValue ::= CHOICE {

Roadmap for python-ldap 2.4

2011-03-21 Thread Michael Ströder
HI! I'd like to get final release 2.4.0 out begin of May and I'm currently thinking of what should still to be added. Focus is still Python 2.x. There are some considerations which I'm not sure about yet: 1. Unicode support for DNs, filter strings, etc. but not entry attributes! (Everybody

please review encode_assertion_control()

2011-03-03 Thread Michael Ströder
HI! (Sigh!) I'm not a C programmer. Could somebody please look what's wrong with encode_assertion_control() in Modules/ldapcontrol.c? It seg faults. $ python -c import ldap;print repr(ldap.encode_assertion_control('(objectClass=*)')) Segmentation fault (core dumped) You have to set

Re: LDAP for Python 3.x

2011-03-02 Thread Michael Ströder
Dusan Stefanik wrote: I decided to take python-ldap-2.3.13 few days ago and I made som changes to get it work on python3. Now I have working version for python3 (tested on Ubuntu 10.4 LTS x64 and Debian Squeeze x64). You can try it. It can be start point for new branche of

Re: python-ldap hanging for 15 minutes under certain conditions

2011-02-04 Thread Michael Ströder
Michael Wood wrote: I do hold out some hope that issues like this in GnuTLS (or in the software using GnuTLS?) can get fixed, though. The issues with GnuTLS are known since years now I suspect that everybody setting up a serious (Open-)LDAP deployment just builds with OpenSSL and

Re: AIX 6.1 install trouble.

2010-09-30 Thread Michael Ströder
Tom Baxter wrote: Hello, I am having trouble install python-ldap on an AIX 6.1 host. I have compiled the openldap libraries and am trying to install without any extras like SSL/crypt. Below is my setup.cfg, attached is the out put from python setup.py build. Any guidance would be greatly

Re: Installing python-ldap 2.3.12 fails

2010-09-21 Thread Michael Ströder
Subject: Re: python-ldap-2.3.12: Compile error on CentOS 5.5, i386 Date: Wed, 11 Aug 2010 20:42:56 +0200 From: Michael Ströder mich...@stroeder.com To: Zhang Huangbin zhbmaillisto...@gmail.com CC: Python Developer List python-ldap-dev@lists.sourceforge.net Zhang Huangbin wrote: On Aug 9, 2010

Re: sasl bind issues

2010-07-19 Thread Michael Ströder
Uma Sridharan wrote: Here is a sample code that works the first time I run the loop and fails the second time with the following error. can someone let me know if the credentials are cached by the library or what could be wrong? Any help is greatly appreciated. ldap.INVALID_CREDENTIALS:

Re: _ldap.so: undefined symbol: gnutls_alert_send

2010-05-03 Thread Michael Ströder
Jean-Sébastien Mansart wrote: I've got this error with a Zope/Plone site : Traceback (most recent call last): [..] ImportError: /home/zope/z_sgec/buildout-cache/eggs/python_ldap-2.3.11-py2.4-linux-i686.egg/_ldap.so: undefined symbol: gnutls_alert_send I have install gnutls1.3,

Re: ldap.open() SSL patch

2010-04-18 Thread Michael Ströder
ygormu...@dcc.ufba.br wrote: Michael Ströder mich...@stroeder.com: Yes, you're right. I would accept such a patch. ;-) At least it's documented: http://www.python-ldap.org/doc/html/ldap.html#ldap.open I was using ldap.open because there are many code samples where it's still used

Re: ldif.py won't parse with 'python -tt'

2010-03-29 Thread Michael Ströder
John Morrissey wrote: ldif.py won't parse with the python option '-tt', which enforces consistent whitespace. It's a simple fix of replacing the handful of tabs with spaces. Thanks for reporting that. Should be fixed in HEAD now. Ciao, Michael.

Re: ldap.DECODING_ERROR in ldap.dn.str2dn with python2.4 on amd64

2010-03-12 Thread Michael Ströder
Arvid Requate wrote: we had a problem with ldap.dn.str2dn showing instable behavior and throwing ldap.DECODING_ERROR in python2.4 Debian Lenny (amd64). It seems that using PyArg_ParseTuple with format string z# and saving the length of the string directly into the berval member bv_len does

Re: edirectory question

2010-03-12 Thread Michael Ströder
Yeargan, Yancey wrote: Your question is really about Novell eDirectory, not the Python LDAP module; That's definitely related to Novell eDirectory. I vaguely remember that some eDirectory allowed searching with an empty search root. Not sure but worth a short test. Ciao, Michael.

Re: Contributing Mac OS X packages to PyPI

2010-03-04 Thread Michael Ströder
Ben Gollmer wrote: I have built universal binary packages for Python-LDAP 2.3.10 on both Mac OS X 10.5 (Python 2.5) and 10.6 (Python 2.6). Is it possible to add these to the PyPI page, to go along with the Windows installers? They can be very useful for users that don't have Xcode / gcc

Re: Anyone using LDAPObject.manage_dsa_it()?

2010-02-26 Thread Michael Ströder
Michael Ströder wrote: For some time there has been a warning in the docs about LDAPObject.manage_dsa_it() soon vanishing from python-ldap once full support for LDAPv3 controls is implemented. Since we have that for quite some time now this inherently broken method should be removed. Anyone

ANN: python-ldap-2.3.11

2010-02-26 Thread Michael Ströder
. processing LDIF, LDAPURLs and LDAPv3 schema). Ciao, Michael. -- Michael Ströder E-Mail: mich...@stroeder.com http://www.stroeder.com Released 2.3.11 2010-02-26 Changes since 2.3.10: Lib/ * Fixed LDAP URL parsing with four ? but no real

Re: python_ldap 2.3.11 broken on pypi

2010-02-26 Thread Michael Ströder
Tobias Schmidt wrote: could it be that the latest release of python_ldap (2.3.11) is broken on pypi? It didn't work inside my buildout and I could not open the archive after downloading it manually. Error message: gzip: stdin: unexpected end of file tar: Child returned status 1 tar:

ldap.ldapobject.SmartLDAPObject removed

2010-02-05 Thread Michael Ströder
Michael Ströder wrote: Well, SmartLDAPObject is not well tested nor documented and should probably be removed anyway... [..] Well, tls_cacertfile is simply not used in SmartLDAPObject.__init__(). The reason is that OpenLDAP libs 2.3 were not able to set connection-specific SSL options

Anyone using LDAPObject.manage_dsa_it()?

2010-02-05 Thread Michael Ströder
HI! For some time there has been a warning in the docs about LDAPObject.manage_dsa_it() soon vanishing from python-ldap once full support for LDAPv3 controls is implemented. Since we have that for quite some time now this inherently broken method should be removed. Anyone still using it? If yes,

Re: ldaps and Active Directory

2010-02-01 Thread Michael Ströder
Patrick A. Treptau wrote: I am pulling my hair out trying to connect via ldaps to one of our AD controllers. host = ldaps://ad_host:636 You should always use the fully-qualified which is in the CN of the server certificate's subject DN. #openssl s_client -CAfile path/to/cert.crt -connect

Re: How can i add a booleanMatch type attribute

2010-01-31 Thread Michael Ströder
Zhang Huangbin wrote: How can i add a booleanMatch type attribute with py-ldap? Simply like any other attribute provided your attribute value is TRUE or FALSE. Refer to python-ldap-2.3.10/Demo/ldapcontrols.py, i use below code to add new attribute: l =

Re: How get get more search resul ts than the server’s sizelimit?

2010-01-18 Thread Michael Ströder
Dave Kirby wrote: Hi, I am trying to search for all groups on a server, but there are more than the server sizelimit results, so the search fails to get them all. My understanding is that the only way to get round this is to use a paged search control with the search, Which LDAP server

Re: How get get more search results than the server’ s sizelimit?

2010-01-18 Thread Michael Ströder
Dave Kirby wrote: 2010/1/18 Michael Ströder mich...@stroeder.com: Dave Kirby wrote: [snip] but according to the python-ldap docs controls are not supported for the search functions even though they are for other functions. Which version of python-ldap and docs are you referring to? I

Re: Multiple Email Values

2010-01-09 Thread Michael Ströder
Chris Dukes wrote: On Wed, Dec 30, 2009 at 02:41:03PM +0100, Christoph Holtermann wrote: I use LDAP for storing my contacts. I keep thinking about the simple case of people having multiple email. One case would be to have an attribute mail another one mozillaSecond Email. On the other hand I

Re: Patch for broken slapd.py

2009-12-18 Thread Michael Ströder
Christian Oudard wrote: 2009/12/17 Michael Ströder mich...@stroeder.com: In this case I'm not familiar with slapd.py which was written by David and after glancing over it I strongly dislike some of the assumptions made therein. So I'm not going to touch that now because of lack of time. I'm

Re: Patch for broken slapd.py

2009-12-17 Thread Michael Ströder
Christian Oudard wrote: On my system, slapd.py fails because of a missing /var/tmp/python-ldap-test . Not sure what your patch submission procedure is, but here's a patch to fix that: Hmm, normally I review patches and commit them. So you did the right thing posting it here. In this case

Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-13 Thread Michael Ströder
Zhang Huangbin wrote: On Nov 5, 2009, at 1:14 AM, Michael Ströder wrote: This is because of older OpenLDAP libs. Try the patch below. It's also in HEAD now. I tested patch moment ago, failed to build, same as in HEAD (checked out moment ago): Sorry, please try again from HEAD. I fixed

Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-12 Thread Michael Ströder
Rob Orsini wrote: Hi, I'm also having trouble getting 2.3.10 to compile on RHEL 5. I tried applying the patches supplied in this thread (I just joined this email list, btw): In file included from Modules/LDAPObject.c:4: Modules/common.h:10:20: error: Python.h: No such file or directory

Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-04 Thread Michael Ströder
Zhang Huangbin wrote: I got below compile error on Red Hat Enterprise Linux 5.3 (x86_64) with python-ldap-2.3.10, but 2.3.8 was compiled and installed success. What's wrong with it? Modules/constants.c:184: error: ‘LDAP_OPT_X_TLS_NEWCTX’ undeclared Well, I asked for testing long

Re: connection pooling

2009-11-04 Thread Michael Ströder
Anil wrote: I am looking to do connection pooling and am thinking of doing something like http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/pooling.html Can you guys give some advice and/or better yet, has someone already done this? I don't know any connection pooling for

Re: Preparing release 2.3.10, please test!

2009-10-23 Thread Michael Ströder
Chris Dukes wrote: The following patch allows the LDAP_OPT_X_TLS_PROTOCOL_MIN to work with libldap2-dev 2.4.9-0ubuntu0 Thanks. I've committed this patch in HEAD. Please test. Ciao, Michael. -- Come build with us! The

Re: Add msgid to info dict created by LDAPerror.

2009-10-23 Thread Michael Ströder
Chris Dukes wrote: While rewriting a nasty perl LDAP sync program in python I encountered one quirk with python-ldap that made my life a bit difficult. When doing asynchronous searches an ldap exception in result3() doesn't include 'msgid' in the info dict. Since I'm tracking pending work by

Re: python-ldap on CIFS

2009-10-07 Thread Michael Ströder
phobie wrote: C:\ \\somehost\someshare\python2.6\python.exe import ldap Traceback (most recent call last): File stdin, line 1, in module File \\somehost\someshare\python2.6\lib\site-packages\python_ldap-2.3.8-py2.6-win32.egg\ldap\__init__ .py, line 22, in module from _ldap import *

Re: Expired server certificate

2009-09-14 Thread Michael Ströder
Fredrik, I've learned the hard way now that settings in .ldaprc and ldap.conf have precedence over what you set in your Python code via ldap.set_option() or LDAPObject.set_option(). Best thing is to use this code-line to completely switch off processing of .ldaprc and ldap.conf in libldap:

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: What's the best way to 'replace' value of attribute which can handle multiple values? Such as: dn: uid=myuid,dc=example,dc=com cn: cn1 cn: cn2 cn: cn3 My purpose is to get ldif like this (no cn=cn2 any more): dn: uid=myuid,dc=example,dc=com cn: cn1 cn:

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: On Sep 9, 2009, at 9:32 PM, Michael Ströder wrote: Zhang Huangbin wrote: NO_SUCH_ATTRIBUTE: {'info': 'modify/delete: enabledService: no such value', 'desc': 'No such attribute'} This means the attribute 'enabledService' is not available in the entry at all. So you

Re: Python3 and LDAP

2009-09-09 Thread Michael Ströder
Bruno Aguirre wrote: Hi to all, I'd like to know if there's a version (alpha, beta or stable) to use ldap in python 3. There are still some things to consider. Please dig the mailing list's archive for some discussion. Would you personally be willing to put some effort into the C extension

Re: SASL GSSAPI under Win32

2009-08-23 Thread Michael Ströder
Torsten Kurbad wrote: I'd appreciate to have this in the official docs in a separate section under http://www.python-ldap.org/doc/html/installing.html#building-and-installing that would be great indeed. I had very little time this morning (the internet link of our institute was broken

Re: SASL GSSAPI under Win32

2009-08-23 Thread Michael Ströder
Waldemar Osuch wrote: My build is not static anymore. Now I put all the required *.dll(s) into site-packages\ldap directory. I also put the _ldap.pyd in there too so the extension can find them. This approach work for all the dlls except the SASL plugins. If I put the SASL plugin dlls into

Re: SASL GSSAPI under Win32

2009-08-19 Thread Michael Ströder
Torsten Kurbad wrote: I think, I'm almost there. I have a static libsasl and several static plugin libs, but when I try to link one of the plugins with _ldap.pyd, I get: e:\projects\prereq\built\cyrus-sasl\lib\sasl2\libcrammd5.a(plugin_common.o): In function `plug_ipfromstring':

Re: ldap.passwd_s with Active Direcory

2009-08-05 Thread Michael Ströder
mike.pet...@opengi.co.uk wrote: Michael Ströder wrote: Did you search for the MSDN article? The value has to be in your case above: 'password'.encode('utf-16-le') Note the quotes and the UTF-16 low-endian encoding. Thanks again for your help. I tried that but to no avail. I still get

Re: Python-LDAP for Python 3.0

2009-08-04 Thread Michael Ströder
David, David Leonard wrote: I have been looking at how to build the _ldap module for python3.x. I'm glad you're again working on python-ldap! Several months ago I tried to raise a discussion about this: http://www.mail-archive.com/python-ldap-dev@lists.sourceforge.net/msg00394.html So,

Re: How to verify server certificate

2009-08-04 Thread Michael Ströder
Fredrik Melander wrote: Short question: when negotiating TLS with the LDAP server with start_tls_s(), can I use python-ldap to follow the certificate chain and verify the server certificate? If so, how? The OpenLDAP libs are doing that for you (with the help of an underlying lib like

Re: How to verify server certificate

2009-08-04 Thread Michael Ströder
Fredrik Melander wrote: Michael Ströder schrieb: Fredrik Melander wrote: Short question: when negotiating TLS with the LDAP server with start_tls_s(), can I use python-ldap to follow the certificate chain and verify the server certificate? If so, how? The OpenLDAP libs are doing

Re: ldap.passwd_s with Active Direcory

2009-08-04 Thread Michael Ströder
mike.pet...@opengi.co.uk wrote: I'm not sure if this is the right place for this query, but I couldn't find a python-LDAP-Users list. I'm trying to modify a user's password on an Windows 2003 Active directory using passwd_s, however the server is returning the following error: {'info':

Re: ldap.passwd_s with Active Direcory

2009-08-04 Thread Michael Ströder
mike.pet...@opengi.co.uk wrote: There's a MSDN article about how to set attribute unicodePwd via LDAP in AD. If I try the alternative method however: mod_attrs = [( ldap.MOD_REPLACE, 'unicodePwd', 'password' )] dn = 'CN=Barney Rubble,OU=Users,DC=mydomain,dc=local' r = l.modify_s(dn,

Re: Typo error in Demo/Lib/ldap/async/deltree.py (2.3.9)

2009-08-01 Thread Michael Ströder
Zhang Huangbin wrote: There's an incorrect module name in Demo/Lib/ldap/async/deltree.py, it seems 'ldap.async.SearchHandler' should be replaced by 'ldap.async.AsyncSearchHandler'. Thanks for pointing this out. Fixed in HEAD. Please test. Ciao, Michael.

Re: version 2.3.8

2009-07-31 Thread Michael Ströder
Waldemar Osuch wrote: On Thu, Jul 9, 2009 at 9:07 AM, Larry kavanaghlarrykavan...@examiner.ie wrote: Hi .. Triying to install python-ldap-2.3.8 using the EXE on a server (windows 2000) that has python 2.4.4 installed (or so the plone site tells me) however it won't install and tells me

To do: LDAPv3 response controls / ldap.LDAPError exceptions

2009-07-26 Thread Michael Ströder
HI! In some situations there are controls attached to a LDAP response also in the case if LDAPResult::resultCode is not success(0). python-ldap just generates an exception in this case with resultCode, diagnosticMessage etc. But a calling application might also need to have access to the controls

ANN: python-ldap-2.3.9

2009-07-26 Thread Michael Ströder
. processing LDIF, LDAPURLs and LDAPv3 schema). Ciao, Michael. -- Michael Ströder E-Mail: mich...@stroeder.com http://www.stroeder.com Released 2.3.9 2009-07-26 Changes since 2.3.8: Lib/ * All modules (ldap, ldif, dsml and ldapurl) have

Re: Apache DS ignores attrsonly

2009-07-13 Thread Michael Ströder
Michael Ströder wrote: Thorsten Kampe wrote: [4] connection.search_s('ou=system', ldap.SCOPE_SUBTREE, filterstr='(cn=*)', attrlist = ['cn'], attrsonly = True) Just a wild guess: Could you please try again with attrsonly=1. Note that this API has its roots in Python 1.x times where

Re: Egg news :-)

2009-07-07 Thread Michael Ströder
Torsten Kurbad wrote: @Michael: Can you please Please check http://www.python-ldap.org/download.shtml whether that's ok. Ciao, Michael. -- Enter the BlackBerry Developer Challenge This is your chance to win up to

Re: python-ldap search_s hanging problem on Linux box

2009-06-24 Thread Michael Ströder
Todd Hanson wrote: I have a query that was written in python (2.5) utilizing the python-ldap package (newest stable version for both Windows and Linux) to query an Active Directory server for a user’s group membership. The code works fine on my test machine (2-3 seconds for result) which is

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Michael Ströder
Zhang Huangbin wrote: Does anyone has working code snippet of server/client side sorting? I use serverctrls in search_ext_s() like this: search_ext_s(, serverctrls = [ ldap.controls.LDAPControl('1.2.840.113556.1.4.473',1,None) ],) got error msg:

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Michael Ströder
Zhang Huangbin wrote: Michael Ströder wrote: 100+ entries are not so many. So you could try sorting the list of search results retrieved with LDAPObject.ldap_search_ext_s() by invoking list method .sort(). Make sure you understand how to control the comparisons. See item 8. here: http

ldap.OPT_X_SASL_NOCANON (was: ANN: python-ldap-2.3.8)

2009-05-04 Thread Michael Ströder
Geert Jansen wrote: 2009/5/3 Michael Ströder mich...@stroeder.com: Why didn't you patch LDAP_get_option()? That is an oversight. It should be updated as well. New patch attached. If I also extend LDAP_get_option() l.get_option(ldap.OPT_X_SASL_NOCANON) will always return -1 if set to any

Re: ANN: python-ldap-2.3.8

2009-05-03 Thread Michael Ströder
Geert Jansen wrote: could you have a look at the patch that i submitted a while ago to expose LDAP_OPT_X_SASL_NOCANON? This option is a new LDAP option that disables SASL host name canonicalization. It is very useful in Windows AD environments. Sorry, this was still in the pipe. Questions:

Re: how can LDAP injection blocked?

2009-04-28 Thread Michael Ströder
mete bilgin wrote: I'm developing a web-based ldap gui with python ( with python-ldap ). And i miss something about security. How can i blocked ldap injection? Could you please elaborate on what you mean with ldap injection? Most security issues with attacking the connection can be cured with

Re: ldapsearch vs. python-ldap

2009-04-11 Thread Michael Ströder
You might also have hit the problem with automatic referral chasing within libldap as anonymous. Try this to switch that off: l = ldap.initialize('ldap://host:389') l.set_option(ldap.OPT_REFERRALS,0) try: #l.simple_bind_s('first.l...@example.com', getpass.getpass())

Limited the usage of SF services for python-ldap

2009-04-09 Thread Michael Ströder
HI! Please note that from now on python-ldap releases and docs will not be made available trough SF's file release area anymore. SF's new web interface is even worse than the old one. The download pages are much too complicated for implementing automatic installation. The web page

Re: Anyone packaged python-ldap as part of a bigger package ?

2009-04-06 Thread Michael Ströder
Roland Hedberg wrote: One problem I've already found is that there doesn't seem to exist a simple stable FTP/HTTP URL that points to the latest distribution. Do you need a URL which is always the same but points to the latest tar.gz file? Ciao, Michael.

Re: Recursive ldap lookups

2009-04-02 Thread Michael Ströder
Fredrik Melander wrote: I was wondering if/how I can make recursive lookups in my ldap-tree (corresponding to the -C option of ldapsearch), Which ldapsearch tool are you talking about? OpenLDAP's command-line tool ldapsearch does not have an option -C. Do you have several implementations of

Re: Segfault in LDAPerror() when errnum is out of bounds

2009-03-20 Thread Michael Ströder
Sean Burford wrote: 2009/3/20 Michael Ströder mich...@stroeder.com mailto:mich...@stroeder.com many thanks for digging through this. Does that mean your issues with syncrepl controls and l_ldap_result3() are fixed? Yeah. There are still mysteries, but RefreshOnly works well

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-18 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-17 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Michael Ströder
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

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Michael Ströder
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

Re: change password for user

2009-03-09 Thread Michael Ströder
Zhang Huangbin wrote: Michael Ströder wrote: Yes. Other LDAP servers might have a different configuration. Also some servers set other password attributes as well (e.g. the smbk5pwd overlay for OpenLDAP sets Samba password attributes and the Kerberos keys for a heimdal KDC). How can i set

Re: change password for user

2009-03-08 Thread Michael Ströder
Jan-Frode Myklebust wrote: I have a script that tries to sync a userdatabase with plaintext username/password in mysql, to a Centos Directory Server. Currently I've been pushing the passwords into the directory by first creating the SSHA1 hash in python and store '{SSHA}' + encode-string in

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-05 Thread Michael Ströder
pyldap.20.dlo...@neverbox.com 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

Re: Distinguished name problem

2009-02-16 Thread Michael Ströder
Fredrik Melander wrote: From the command line (ldapsearch) I've got no problem becoming whatever I want. The python-ldap module on the other hand gives me *almost* anything I want. The only thing that I seem to not be able to get is the DN. The 2-tuples returned by ldap_search_s() etc. are

Re: Updated eggs for linux x86 and amd64

2009-01-30 Thread Michael Ströder
Sidnei da Silva wrote: On Thu, Jan 29, 2009 at 5:43 PM, Waldemar Osuch waldemar.os...@gmail.com wrote: On Thu, Jan 29, 2009 at 1:17 AM, Torsten Kurbad python-l...@tk-webart.de wrote: On Thursday, January 29, 2009 at 03:44 Sidnei da Silva wrote: The best way really would be to build it

Re:

2009-01-28 Thread Michael Ströder
solomon_anto...@emc.com wrote: I tried using the platform install and for some reason I get this error. ImportError: ld.so.1: python: fatal: libresolv.so.2: open failed: No such file or directory Also I ran ldd on the libresolve.so.2 libresolv.so.2 =/usr/lib/libresolv.so.2

Re:

2009-01-26 Thread Michael Ströder
solomon_anto...@emc.com wrote: I wanted to know if any of you were successful in getting python-ldap installed on solaris 10. if so could you point me to any instructions that you might have? I've installed it with the usual platform-independent method:

Re: How to change the password of a LDAP entry as LDAP administrator

2009-01-15 Thread Michael Ströder
Guruprasad wrote: Guruprasad wrote: Hi all, I am new to this Python-LDAP API and am currently learning and working on it. I, the LDAP admin, want to set the password of a LDAP user after binding as the admin user. I came across passwd_s() method which can be used to change the user password,

Re: DSMLParser example

2008-12-18 Thread Michael Ströder
Yves Dorfsman wrote: Michael: Can you confirm this is the way it was supposed to be used, I mean, is this class the sort of argument that should be used for ContentHandler ? Yves Dorfsman wrote: I have tried: x = dsml.DSMLParser(input_file, dsml.DSMLv1Handler) I have noted your

Re: DSMLParser example

2008-12-17 Thread Michael Ströder
Yves Dorfsman wrote: Michael Ströder wrote: Yves Dorfsman wrote: But eventually it fails with an HTTP 404 error... ??? Yes I was confused too. [..] File /usr/lib/python2.5/urllib2.py, line 506, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp

Re: Certificate checking on LDAP over SSL connection

2008-12-10 Thread Michael Ströder
Alberto Lopes wrote: subject= issuer=/DC=srf/CN=AC DN [..] From the subject= line, one could see that the server certificate is subjectless. Why do you use such a invalid cert? Fix this. Do you think that's the reason why I couldnt' connect via python-ldap? Yes. Ciao, Michael.

Re: Certificate checking on LDAP over SSL connection

2008-12-09 Thread Michael Ströder
Alberto Lopes wrote: From what I understood from the LDAPUserFolder code, it delegates the SSL negotiation to the python-ldap library. And further down the delegation path: python-ldap - OpenLDAP lib - OpenSSL lib How can I pass the CAcertificate to the python-ldap layer in order to have

Re: Certificate checking on LDAP over SSL connection

2008-12-09 Thread Michael Ströder
Alberto Lopes wrote: ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,'/path/to/my/CAcert') l = ldap.initialize('ldaps://server:port',trace_level=ldapmodule_trace_level,trace_file=ldapmodule_trace_file) l.protocol_version=ldap.VERSION3 l.bind_s('','',ldap.AUTH_SIMPLE) Here, I got the

Thoughts on python-ldap 3.0

2008-11-07 Thread Michael Ströder
HI! Given that Python 3.0 makes good progress it's worth to think about how to provide a LDAP module for Python 3.0. Glancing over PEP 3000 it's pretty obvious that python-ldap could be changed more than just adding a few compability patches needed for 2.5 or 2.6 since Python 3.0 seems to be a

Re: Thoughts on python-ldap 3.0

2008-11-07 Thread Michael Ströder
Michael Ströder wrote: Some ideas: Forgot one point: I'd prefer python-ldap to be part of the Python standard lib in the long run. New code would make it possible to meet the licensing prerequisites of the PSF for this from the very beginning. Ciao, Michael

Re: configure: error: BDB/HDB: BerkeleyDB not available

2008-10-05 Thread Michael Ströder
Andre Basel wrote: When trying to install OpenLDAP , I get the above error. How do I install BerkeleyDB, or make it available? It's more appropriate to ask questions about how to install OpenLDAP on the openldap-software mailing list: http://www.openldap.org/lists/ FWIW: If you just need

Re: python-ldap wrong auth. after server down

2008-09-26 Thread Michael Ströder
Please don't e-mail me personally. Stay on the mailing list! mete bilgin wrote: 2008/9/26 Michael Ströder [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mete bilgin wrote: i'm trying to connect ldap into python. when i give it to true username and password, nothing going

Re: ldap.modlist.modifyModlist() (resent to list)

2008-09-23 Thread Michael Ströder
Paul Wankadia wrote: On Fri, Sep 19, 2008 at 6:12 PM, Michael Ströder [EMAIL PROTECTED] wrote: The current implementation of modifyModlist() clashed with some ACLs because it touches too many values. :/ I don't fully understand. Do you have ACLs based on certain attribute values? It would

Re: ldap.modlist.modifyModlist()

2008-09-19 Thread Michael Ströder
Paul Wankadia wrote: The current implementation of modifyModlist() clashed with some ACLs because it touches too many values. :/ I don't fully understand. Do you have ACLs based on certain attribute values? It would be probably a good idea to mention these issues in the docs. Here's a

Re: Change password

2008-09-16 Thread Michael Ströder
Jonathan Hansen wrote: Does anyone have a working password change script for active directory server that will run on Linux? My web2ldap implements it. But it's not a small script. Depending on your use-case you might consider deploying web2ldap though. At least for learning how the data

Re: Problem using ldaps with two different CA cert files

2008-09-11 Thread Michael Ströder
Rich Megginson wrote: Is it possible to use two different CA certs in a single python-ldap app? There are two options: 1. Stuff all trusted CA certs into one PEM file and use ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/path/to/allcacerts.pem') 2. Copy all CA certs in a directory and use

Re: How to get a user's OUs

2008-09-10 Thread Michael Ströder
Gustavo Narea wrote: On Monday September 8, 2008 23:47:19 you wrote: This question is not very clear. Do you mean the attribute 'ou' of the user's entry or the ou-Container the user's entry is in? If you're working with AD it's probably the latter. Then it's the DN of the user's entry

Re: How to get a user's OUs

2008-09-08 Thread Michael Ströder
Gustavo Narea wrote: How can I retrieve the Organizational Units a user belongs to via python-ldap? This question is not very clear. Do you mean the attribute 'ou' of the user's entry or the ou-Container the user's entry is in? If you're working with AD it's probably the latter. Then it's the

Re: Creating Active Directory Objects

2008-08-30 Thread Michael Ströder
Randy wrote: Mike (or anyone else who has successfully changed an Active Directory password using python-ldap over SSL), I have not found an update in the archives to your last message on this subject (below). Can you perhaps share some Python code showing how to add or change the password

Re: problem using python-ldap under fcgi

2008-08-27 Thread Michael Ströder
Matt Bartolome wrote: Hey Michael. Thank you for your response. I modified LDAPObject.c and ldapcontrol.c to use the solution described here: https://bugs.launchpad.net/ubuntu/+source/python-cdb/+bug/157251 Looks like it is something specific to glibc in ubuntu and the recommended use of

Re: problem using python-ldap under fcgi

2008-08-27 Thread Michael Ströder
Matt Bartolome wrote: My apologies on the wild goose chase but after using valgrind on my fcgi process it is python cx_Oracle (would have never guessed that!) which triggers the segmentation fault when ldap.initialize() is called. Why it does this is beyond me but a simple alteration of my

Re: problem using python-ldap under fcgi

2008-08-27 Thread Michael Ströder
Matt Bartolome wrote: I'll take a stab at this. I'll give you fair warning though that I don't know much about C. It looks like the modifications would be fairly straight forward though given I can find the recommended usage and documentation. I left off at the type cast build warnings so I

  1   2   >