The set_password method on Samba::LDAP::User builds user's DN based on
the uid and the usersdn setting from smbldap.conf, which doesn't work
for hierarchical LDAP deployments.
Developers should be able _at least_ to specify the object DN in the
args hash passed to the method. Please find attached a patch for User.pm
which implements this functionality while still retaining the assumption
that user are all under $self->{usersdn}
Thanks for your time,
Jose
Subject: | User.pm.patch |
--- Samba-LDAP-0.03/lib/Samba/LDAP/User.pm 2006-04-07 03:51:05.000000000 -0400
+++ /usr/share/perl5/Samba/LDAP/User.pm 2008-03-07 15:15:57.000000000 -0430
@@ -97,7 +97,12 @@
if ( defined( $args{oldpass} ) eq $args{newpass} );
# Set the $dn
- my $dn = "uid=$args{user},$self->{usersdn}";
+ my $dn;
+ if ( defined $args{dn} ) {
+ $dn = $args{dn};
+ } else {
+ $dn = "uid=$args{user},$self->{usersdn}";
+ }
if ( $args{user} && $args{oldpass} && $args{newpass} ) {
$self->{masterDN} = "uid=$args{user},$self->{usersdn}";