Fixed PAM MD5 password detection

This commit is contained in:
Jamie Cameron
2007-11-23 02:26:13 +00:00
parent 50af252157
commit b8a9a76aff
2 changed files with 9 additions and 1 deletions

View File

@@ -35,3 +35,4 @@ Use the nscd -i command to refresh its cache after adding a user or group.
In a user batch file, # is only treated as a comment at the start of a line.
---- Changes since 1.380 ----
The real base directory for homes is now respected when batch creating users.
Improved MD5 encryption auto-detection with newer PAM config files.

View File

@@ -69,7 +69,7 @@ if (&foreign_check("pam")) {
&foreign_require("pam", "pam-lib.pl");
local @conf = &foreign_call("pam", "get_pam_config");
local ($svc) = grep { $_->{'name'} eq 'passwd' } @conf;
LOOP: foreach $m (@{$svc->{'mods'}}) {
LOOP: foreach my $m (@{$svc->{'mods'}}) {
if ($m->{'type'} eq 'password') {
if ($m->{'args'} =~ /md5/) { $md5++; }
elsif ($m->{'module'} =~ /pam_stack\.so/ &&
@@ -79,6 +79,13 @@ if (&foreign_check("pam")) {
if ($svc) { goto LOOP }
else { last; }
}
elsif ($m->{'control'} eq 'include') {
# Include another section
($svc) = grep { $_->{'name'} eq $m->{'module'} }
@conf;
if ($svc) { goto LOOP }
else { last; }
}
}
}
}