mirror of
https://github.com/webmin/webmin.git
synced 2026-09-22 05:20:38 +01:00
Ensure that old password is requested before new one is sent
This commit is contained in:
1
lang/en
1
lang/en
@@ -314,6 +314,7 @@ password_enew2=Your new passwords do not match
|
||||
password_epam=PAM error : $1
|
||||
password_emodpam=The Authen::PAM perl module needed to do password changes is not installed!
|
||||
password_enewpass=New password is not allowed : $1
|
||||
password_enotold=Password change commit did not prompt for old password!
|
||||
|
||||
ui_mandatory=This field is mandatory
|
||||
ui_checkmandatory=Nothing was selected
|
||||
|
||||
@@ -58,6 +58,7 @@ elsif ($gconfig{'passwd_cmd'}) {
|
||||
$passwd_cmd .= " ".quotemeta($in{'user'});
|
||||
($fh, $fpid) = &proc::pty_process_exec($passwd_cmd, 0, 0);
|
||||
&reset_environment();
|
||||
my $sent_old = 0;
|
||||
while(1) {
|
||||
local $rv = &wait_for($fh,
|
||||
'(new|re-enter).*:',
|
||||
@@ -70,11 +71,13 @@ elsif ($gconfig{'passwd_cmd'}) {
|
||||
sleep(1);
|
||||
if ($rv == 0) {
|
||||
# Prompt for the new password
|
||||
$sent_old || &error($text{'password_enotold'});
|
||||
syswrite($fh, $in{'new1'}."\n", length($in{'new1'})+1);
|
||||
}
|
||||
elsif ($rv == 1) {
|
||||
# Prompt for the old password
|
||||
syswrite($fh, $in{'old'}."\n", length($in{'old'})+1);
|
||||
$sent_old = 1;
|
||||
}
|
||||
elsif ($rv == 2) {
|
||||
# Request for a menu option (SCO?)
|
||||
|
||||
Reference in New Issue
Block a user