Hi!, i'm new in the list, my name is Esteban and i live in Chile.

I'm working with openLDAP since... two week ago (so so)

I need that normal users changes is owm passwords, and this is the script:

#!/usr/bin/perl
use General;
use Net::LDAP;

print "Loggin\n";
my $usuario = <stdin>;
print "Password\n";
my $pass = <stdin>;
my $dn = "uid=$usuario,ou=People,dc=misitio,dc=cl";

my $ldap = Net::LDAP->new('127.0.0.1:389') or die "$@";

$ldap->bind(dn=>"$dn",password=>$pass);

print "New password\n";
my $newpass = <stdin>;
print "Retype your new password\n";
my $newrepass = <stdin>;

if ($newpass eq $newrepass) {
    my $chg = $ldap->modify(dn=>"$dn", replace=>{'userPassword'=>$newpass});
    if ($chg->code != 0) {
        print "The password has not been changed\n";
        print $chg->error;
    } else {
        print "Ok, you have a new password!!!!";
    }
} else {
 print "wrong new password\n";
}

but this script doesn't work!!!!!

If i do the same using the Manager dn, the script works right!!!!
($dn="cn=Manager,dc=misitio,dc=cl")

what about my slapd.conf file????

look:
access to attr=userPassword
    by self write
    by anonymous auth
    by * none
access to *
    by dn.base="cn=Manager,dc=misitio,dc=cl" write

some body can help me?

excuse if i commit a mistake writing in english

Esteban

Reply via email to