ldap .passwd method, need help

Sells, Fred fred at adventistcare.org
Fri Jan 13 15:00:04 CET 2006


I've got the python-ldap version 2.0.11 with python 2.4 under Linux

I've got the ldap stuff working for groups, but now I'm trying to use it to
change a user password.  I get a return of 2 and no error messages but it
does not change ldap.

I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the
same result.

Anyone know what I'm missing?

class LdapUser:
    def __init__(self, uri=uri, binddn=BINDDN, password=""):
        self.ldap = ldap.initialize(uri)
        self.ldap.simple_bind(binddn, password)
    
    def chg_pw(self,uid,oldpw,newpw):
        print self.ldap.passwd_s(uid,oldpw,newpw)


if __name__=="__main__":
    Ldap = LdapUser(password="secret")
    Ldap.chg_pw("uid=joeblow,ou=abc,ou=def,dc=ghi,dc=org","", "new.pass")



---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------



More information about the Python-list mailing list