[python-ldap] SASL + REALM

Michael Ströder michael at stroeder.com
Sun Mar 23 20:07:58 CET 2014

Martin Pfeifer wrote:
> i had a similar problem using SASL. After digging in the python-ldap code
> and the header files of cyrus-sasl and openldap to understand what is going
> on i found that the constant ldap.sasl.CB_GETREALM in python-ldap is set to
> 0x4007 but the sasl.h states that the callback id of CB_GETREALM is 0x4008.
> I reassigned ldap.sasl.CB_GETREALM with 0x4008 in my script and that did
> the trick. As of my understanding this is a bug in python-ldap and needs
> fixing.

I've committed the patch below. Thanks for reporting it.

Ciao, Michael.

Index: Lib/ldap/sasl.py
RCS file: /cvsroot/python-ldap/python-ldap/Lib/ldap/sasl.py,v
retrieving revision 1.15
diff -u -r1.15 sasl.py
--- Lib/ldap/sasl.py	26 Jul 2009 11:09:58 -0000	1.15
+++ Lib/ldap/sasl.py	23 Mar 2014 19:05:15 -0000
@@ -31,7 +31,7 @@
 CB_PASS        = 0x4004
 CB_ECHOPROMPT  = 0x4005
-CB_GETREALM    = 0x4007
+CB_GETREALM    = 0x4008

 class sasl:
     """This class handles SASL interactions for authentication.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2398 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20140323/827983f1/attachment.bin>

More information about the python-ldap mailing list