>Your 2nd search is wrong. Change "sub" to "base".
>
>Also, whenever you are searching you should check your results. i.e.:
>
>my $changeentry = $changeconn->search("$baseDN", "base", "$userDN");
>unless ($changeentry) {
>    die( $changeconn->getErrorCode ?
>            "Error searching directory: " . $changeconn->getErrorString . "\n" :
>            "No match found for dn $baseDN\n"
>    );
>
># End example
>
>Hth...

Well, I have made this change and I see no difference, I only see a
graceful failure of my program, not an error:
[~/jd]$ ./ldapchange jt950001 win98 a
username = jt950001 
Password = win98 
new password = a
Define anonymous connection.
Starting search
Search done
LDAPServer is seawolf
LDAPPort is 389
userDN is uid=jt950001,ou=people, o=jdnet
No match found for dn o=jdnet
Password is win98[~/jd]$

For some reason I cannot search the directory with this DN in the
script. I can with the standalone ldapsearch command in
/usr/netscape/server4/shared/bin.  For example:

[/usr/netscape/server4/shared/bin]$ ./ldapsearch -b o=jdnet -D
'uid=jt950001,ou=people, o=jdnet' -w win98 uid=jt950001
dn: uid=jt950001,ou=People, o=jdnet
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetorgperson
cn: jt950001
uid: jt950001
givenname: first
sn: last
[/usr/netscape/server4/shared/bin]$

I cannot figure out what is going on.  I about to the point of telling
the people I am working on this for to hire a real programmer. 

Kent
-- 
I would like to electrocute everyone who uses the word 'fair' in 
connection with income tax policies. 
                                        -- William F. Buckley

Reply via email to