3 --- smbldap-passwd.orig 2008-04-22 17:13:29.000000000 +0900
5 @@ -99,6 +99,17 @@ if ($< != 0) {
6 system "/bin/stty echo" if (-t STDIN);
9 + { # Check if user dn is stored in subtree.
10 + my $test_conn = connect_ldap_master();
11 + my $usersdn = &get_user_dn($user);
12 + if ($usersdn && $usersdn =~ /^dn: uid=(.+?)(,(.*))?$config{usersdn}/) {
13 + my ($uid,$subtree) = ("","");
14 + $uid = $1; $subtree = defined($3)?$3 : "";
15 + $config{usersdn} = $subtree . $config{usersdn};
20 $config{masterDN}="uid=$user,$config{usersdn}";
21 $config{masterPw}="$oldpass";
22 $ldap_master=connect_ldap_master();
23 @@ -228,7 +239,7 @@ if ( $samba and $update_samba_passwd ) {
24 my $winmagic = 2147483647;
25 my $valacctflags = "[U]";
26 push(@mods, 'sambaPwdMustChange' => 0);
27 - push(@mods, 'sambaPwdLastSet' => 0);
28 + push(@mods, 'sambaPwdLastSet' => $date);
29 push(@mods, 'sambaAcctFlags' => $valacctflags);
31 # Let's change nt/lm passwords