Hi,
Recently I've found that SimpleLDAPObject.passwd doesn't adhere RFC 3062:
PasswdModifyRequestValue ::= SEQUENCE {
userIdentity [0] OCTET STRING OPTIONAL
oldPasswd [1] OCTET STRING OPTIONAL
newPasswd [2] OCTET STRING OPTIONAL }
But in Lib/ldap/ldapobject.py:
def passwd(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
And in Modules/LDAPObject.c:
if (!PyArg_ParseTuple( args, "s#s#s#|OO", &user.bv_val, &user_len, &oldpw.bv_val, &oldpw_len, &newpw.bv_val, &newpw_len, &serverctrls, &clientctrls ))
// ...
ldaperror = ldap_passwd( self->ldap, &user, &oldpw, &newpw, server_ldcs, client_ldcs, &msgid );
So I attach a patch to correct the situation.
The only problem I've found is when newpw is None Python passwd_s method doesn't
return generated password in result as native function does. This doesn't affect
my code but it's obviously a problem. Any suggestions?
The OpenLDAP libldap does adhere the RFC and works as expected with NULL
pointers in place of &user, &oldpw and &newpw.
--
Timur Izhbulatov
OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
P:+7 495 105 7245 + ext.205 F:+7 495 105 7246 E:Tim...@oi...
Building Successful Supply Chains - One Solution At A Time.
www.oilspace.com
|