From: Arne G. G. <ar...@li...> - 2002-07-12 13:57:42
|
Hi, I've attempted to access my LDAP server's password modify extended operation via Net::LDAP, and found what appears to be a bug. In Net::LDAP::extension a message is encoded with the key "extendedRequest". This does not match the id "extendedReq" which is used in Net::LDAP::ASN (and elsewhere in Net::LDAP as well), and attempts to use $ldap->extension consequently bomb out. Upon rectifying this, however, I'm able to access the password modify operation as below, which might perhaps make for a good example of the exop-functionality to include with Net::LDAP. I know I would have appreciated it. :) Arne. #!/usr/bin/perl use strict; use Net::LDAP; use Convert::ASN1; use vars qw($ldap); # LDAP Password Modify Extended Operation, as per RFC 3062 my $id = 'uid=foo,...'; $ldap = Net::LDAP->new('server', version => 3) or die "$@"; $ldap->bind($id, password => 'bar') or die "$!"; my $pwmodoid = '1.3.6.1.4.1.4203.1.11.1'; my $pwmodreq = Convert::ASN1->new; $pwmodreq->prepare(q{ PasswdModifyRequestValue ::= SEQUENCE { userIdentity [0] OCTET STRING OPTIONAL, oldPasswd [1] OCTET STRING OPTIONAL, newPasswd [2] OCTET STRING OPTIONAL } }); my $mesg = $ldap->extension(name => $pwmodoid, value => $pwmodreq->encode(userIdentity => $id, newPasswd => 'zoo')); die $mesg->error if $mesg->code; $ldap->unbind; |