diff --git a/useradmin/CHANGELOG b/useradmin/CHANGELOG index 5ed6c4cb0..1b3994096 100644 --- a/useradmin/CHANGELOG +++ b/useradmin/CHANGELOG @@ -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. diff --git a/useradmin/linux-lib.pl b/useradmin/linux-lib.pl index 30cadf14f..e1589ed7f 100644 --- a/useradmin/linux-lib.pl +++ b/useradmin/linux-lib.pl @@ -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; } + } } } }