summaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--perl-install/authentication.pm19
-rwxr-xr-xperl-install/standalone/drakauth3
2 files changed, 13 insertions, 9 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);
diff --git a/perl-install/standalone/drakauth b/perl-install/standalone/drakauth
index 6a43a2f87..d29f250ca 100755
--- a/perl-install/standalone/drakauth
+++ b/perl-install/standalone/drakauth
@@ -13,8 +13,7 @@ read_all_conf('', my $netc = {}, my $_intf = {});
my $in = 'interactive'->vnew('su');
-
-my $authentication = {}; # TODO
+my $authentication = authentication::get();
my $kind = authentication::to_kind($authentication);
my $meta_class = { getVarsFromSh("/etc/sysconfig/system") }->{META_CLASS};