Buchan Milne a écrit :
set_password was not passing through controls. Please try the attached
lib/Net/LDAP/Extension/SetPassword.pm
The patch works fine, I tested with the attached script, which works as a CGI
or in the console, and uses/supports PasswordPolicy (e.g. if password has
been reset or has expired, user is prompted to change it).
But the patch also triggers an error if no control is actually used:
controls.0.type is undefined at
/usr/lib/perl5/vendor_perl/5.10.0/Net/LDAP/Message.pm
The following patch fixes this issue.
--
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
--- /usr/lib/perl5/vendor_perl/5.10.0/Net/LDAP/Extension/SetPassword.pm
2008-09-17 15:14:54.000000000 +0200
+++ SetPassword.pm 2008-09-17 15:16:20.000000000 +0200
@@ -26,7 +26,7 @@
my $res = $ldap->extension(
name => '1.3.6.1.4.1.4203.1.11.1',
value => $passwdModReq->encode(\%opt),
- control => $opt{control},
+ ($opt{control} ? (control => $opt{control}) : ())
);
bless $res; # Naughty :-)