diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-11-10 15:02:05 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-11-10 15:02:05 +0000 |
commit | 84faa5528bfa7964319b329073e66ff4ab918d8b (patch) | |
tree | f1a50be0614bbb97c458a5fbf776039ceda5acc3 /perl-install/authentication.pm | |
parent | 6cc979271a02e5d5be185711e51b099c566c6db6 (diff) | |
download | drakx-84faa5528bfa7964319b329073e66ff4ab918d8b.tar drakx-84faa5528bfa7964319b329073e66ff4ab918d8b.tar.gz drakx-84faa5528bfa7964319b329073e66ff4ab918d8b.tar.bz2 drakx-84faa5528bfa7964319b329073e66ff4ab918d8b.tar.xz drakx-84faa5528bfa7964319b329073e66ff4ab918d8b.zip |
- correctly restore pam.d/system-auth when setting "local" authentication
- no use_first_pass on "auth sufficient pam_unix.so" line for pam_castella
Diffstat (limited to 'perl-install/authentication.pm')
-rw-r--r-- | perl-install/authentication.pm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm index a66ddf51e..2d0415a38 100644 --- a/perl-install/authentication.pm +++ b/perl-install/authentication.pm @@ -147,7 +147,9 @@ sub set { sshd_config_UsePAM($kind ne 'local'); - if ($kind eq 'SmartCard') { + if ($kind eq 'local') { + set_pam_authentication(); + } elsif ($kind eq 'SmartCard') { $in->do_pkgs->install('castella-pam'); set_pam_authentication('castella'); } elsif ($kind eq 'LDAP') { @@ -349,14 +351,20 @@ sub set_pam_authentication { #- first removing previous config $_ = ''; } - if ($module eq 'pam_unix' && $special{$type} && @{$special{$type}}) { + if ($module eq 'pam_unix' && $special{$type}) { my @para_for_last = - $type eq 'auth' ? qw(likeauth nullok use_first_pass) : - $type eq 'account' ? qw(use_first_pass) : @{[]}; + $type eq 'auth' ? qw(likeauth nullok use_first_pass) : + $type eq 'account' ? qw(use_first_pass) : @{[]}; @para = difference2(\@para, \@para_for_last); - my ($before, $after) = partition { member($_, 'krb5', 'castella') } @{$special{$type}}; - my @l = ((map { [ "pam_$_" ] } @$before), + my ($before_noask, $ask) = partition { $_ eq 'castella' } @{$special{$type}}; + my ($before, $after) = partition { $_ eq 'krb5' } @$ask; + + if (!@$ask) { + @para_for_last = grep { $_ ne 'use_first_pass' } @para_for_last; + } + + my @l = ((map { [ "pam_$_" ] } @$before_noask, @$before), [ 'pam_unix', @para ], (map { [ "pam_$_" ] } @$after), ); |