1 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/util.pm mezzanine_patched_e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/util.pm |
2 |
--- e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/util.pm 2008-03-26 10:22:29.000000000 -0600 |
3 |
+++ mezzanine_patched_e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/util.pm 2008-03-26 10:22:05.000000000 -0600 |
4 |
@@ -637,10 +637,10 @@ |
5 |
{ |
6 |
my ( $username, $oldpassword, $newpassword ) = @_; |
7 |
use Authen::PAM; |
8 |
+ my $state; |
9 |
|
10 |
my $my_conv_func = sub { |
11 |
my @res; |
12 |
- my $state = 0; |
13 |
while (@_) |
14 |
{ |
15 |
my $code = shift; |
16 |
@@ -650,23 +650,14 @@ |
17 |
$ans = $username if ( $code == PAM_PROMPT_ECHO_ON() ); |
18 |
if ( $code == PAM_PROMPT_ECHO_OFF() ) |
19 |
{ |
20 |
- if ( $state >= 1 || $msg =~ /new/i ) |
21 |
+ if ( $< == 0 || $state >= 1 ) |
22 |
{ |
23 |
- |
24 |
# are we asked for a new password |
25 |
$ans = $newpassword; |
26 |
} |
27 |
- elsif ( $msg =~ /^Password:\s*$/i ) |
28 |
- { |
29 |
- |
30 |
- # asked for old password before we can set a new one. |
31 |
- $ans = $oldpassword; |
32 |
- } |
33 |
else |
34 |
{ |
35 |
- |
36 |
- # We shouldn't get here. Just provide a non-sensical |
37 |
- # "old password", if we do. |
38 |
+ # asked for old password before we can set a new one. |
39 |
$ans = $oldpassword; |
40 |
} |
41 |
$state++; |
42 |
@@ -691,6 +682,7 @@ |
43 |
# one. |
44 |
# This does that, except if you're already root, such as from the |
45 |
# bootstrap-console |
46 |
+ $state = 0; |
47 |
unless ( $< == 0 or $pamh->pam_authenticate == 0 ) |
48 |
{ |
49 |
warn |
50 |
@@ -698,6 +690,7 @@ |
51 |
return 0; |
52 |
} |
53 |
|
54 |
+ $state = 0; |
55 |
my $res = $pamh->pam_chauthtok; |
56 |
unless ( $res == PAM_SUCCESS() ) |
57 |
{ |