Novell is now a part of Micro Focus

I want to change users' passwords via LDAP....

Articles and Tips: qna

15 Nov 2000


Q.

I want to change users' passwords via LDAP. I think that it uses ldap_modify function, but I don't know what attribute type is set to LDAPMod parameter. How do I do this?

A.

The attribute you want is "userPassword". Here's a bit of code I've successfully used to change the password:

LDAPMod *mods[2];LDAPMod m;char *s = "mynewpassword;char *v[] = { s, NULL };m.mod_op = LDAP_MOD_REPLACE;m.mod_type = "userPassword";m.mod_values = v;mods[0] = &m;mods[1] = NULL;lerr = ldap_modify_s( ld, "cn=me,o=none", mods );

(Answer provided by Steve Lewis, sedentaryz@yahoo.com)

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates