Lines 266-287
Link Here
|
266 |
if ( $update_unix_passwd ) { |
266 |
if ( $update_unix_passwd ) { |
267 |
my $shadowLastChange=int(time()/86400); |
267 |
my $shadowLastChange=int(time()/86400); |
268 |
my $modify; |
268 |
my $modify; |
|
|
269 |
my @mods; |
269 |
if ($< != 0) { |
270 |
if ($< != 0) { |
270 |
$modify = $ldap_master->modify ( "$dn", |
271 |
push @mods, 'userPassword' => "$hash_password"; |
271 |
changes => [ |
|
|
272 |
replace => [userPassword => "$hash_password"], |
273 |
replace => [shadowLastChange => "$shadowLastChange"] |
274 |
] |
275 |
); |
276 |
} else { |
272 |
} else { |
277 |
$modify = $ldap_master->modify ( "$dn", |
273 |
push @mods, 'userPassword' => "$hash_password"; |
278 |
changes => [ |
274 |
push @mods, 'shadowLastChange' => "$shadowLastChange"; |
279 |
replace => [userPassword => "$hash_password"], |
275 |
if ( defined $config{defaultMaxPasswordAge} ) { |
280 |
replace => [shadowLastChange => "$shadowLastChange"], |
276 |
push @mods, 'shadowMax' => "$config{defaultMaxPasswordAge}"; |
281 |
replace => [shadowMax => "$config{defaultMaxPasswordAge}"] |
277 |
} |
282 |
] |
|
|
283 |
); |
284 |
} |
278 |
} |
|
|
279 |
$modify = $ldap_master->modify ( "$dn", 'replace' => { @mods } ); |
285 |
$modify->code && warn "Failed to modify UNIX password: ", $modify->error ; |
280 |
$modify->code && warn "Failed to modify UNIX password: ", $modify->error ; |
286 |
} |
281 |
} |
287 |
|
282 |
|