summaryrefslogtreecommitdiffstats
path: root/perl-install/authentication.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-03 07:04:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-03 07:04:44 +0000
commitdf93256cccd635dfbcaffe5d3240956bdd60ecb4 (patch)
treeeac98032ac24df8acdb9494e7b96bcf8b097eb53 /perl-install/authentication.pm
parentf42c230718d177bf87fa01e1302cbd669485b24c (diff)
downloaddrakx-df93256cccd635dfbcaffe5d3240956bdd60ecb4.tar
drakx-df93256cccd635dfbcaffe5d3240956bdd60ecb4.tar.gz
drakx-df93256cccd635dfbcaffe5d3240956bdd60ecb4.tar.bz2
drakx-df93256cccd635dfbcaffe5d3240956bdd60ecb4.tar.xz
drakx-df93256cccd635dfbcaffe5d3240956bdd60ecb4.zip
read existing authentication conf (only minimal support for now)
Diffstat (limited to 'perl-install/authentication.pm')
-rw-r--r--perl-install/authentication.pm19
1 files changed, 12 insertions, 7 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm
index 7a73e0c7c..c59bc2d2e 100644
--- a/perl-install/authentication.pm
+++ b/perl-install/authentication.pm
@@ -194,9 +194,14 @@ sub ask_root_password_and_authentication {
sub get() {
- my $system_auth = cat_("/etc/pam.d/system-auth");
+ my @pam_kinds = get_pam_authentication_kinds();
+ my @kinds = grep { intersection(\@pam_kinds, $kind2pam_kind{$_}) } keys %kind2pam_kind;
- { md5 => $system_auth =~ /md5/, shadow => $system_auth =~ /shadow/ };
+ my $system_auth = cat_("/etc/pam.d/system-auth");
+ {
+ md5 => $system_auth =~ /md5/, shadow => $system_auth =~ /shadow/,
+ if_(@kinds, $kinds[0] => ''),
+ };
}
sub set {
@@ -383,6 +388,11 @@ sub get_raw_pam_authentication() {
\%before_deny;
}
+sub get_pam_authentication_kinds() {
+ my $before_deny = get_raw_pam_authentication();
+ map { s/pam_//; $_ } keys %{$before_deny->{auth}};
+}
+
sub set_pam_authentication {
my (@authentication_kinds) = @_;
@@ -447,11 +457,6 @@ sub set_pam_authentication {
} "$::prefix/etc/pam.d/system-auth";
}
-sub get_pam_authentication_kinds() {
- my $before_deny = get_raw_pam_authentication();
- map { s/pam_//; $_ } keys %{$before_deny->{auth}};
-}
-
sub set_nsswitch_priority {
my (@kinds) = @_;
my @known = qw(nis ldap winbind);