summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-08 17:31:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-08 17:31:36 +0000
commit6887bb46366245ba10c35d907dc6a3f206d804b1 (patch)
treeef66e7dcc4f74ebac72ed8574365e8807136e0a3 /perl-install/any.pm
parent85f7d9cca33fdfb0688789e4116db9f0b1c88fa5 (diff)
downloaddrakx-6887bb46366245ba10c35d907dc6a3f206d804b1.tar
drakx-6887bb46366245ba10c35d907dc6a3f206d804b1.tar.gz
drakx-6887bb46366245ba10c35d907dc6a3f206d804b1.tar.bz2
drakx-6887bb46366245ba10c35d907dc6a3f206d804b1.tar.xz
drakx-6887bb46366245ba10c35d907dc6a3f206d804b1.zip
- integrate chkauth (which is now deprecated)
- new module authentication
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm97
1 files changed, 0 insertions, 97 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 8592edc43..68f994407 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -954,101 +954,4 @@ sub config_mtools {
} $file;
}
-
-sub authentication_kinds() {
- ('local', 'LDAP', 'NIS', 'winbind');
-}
-sub authentication_kind2description {
- my ($kind) = @_;
- ${{ local => N("Local files"), LDAP => N("LDAP"), NIS => N("NIS"), winbind => N("Windows Domain") }}{$kind};
-}
-sub authentication2authentication_kind {
- my ($authentication) = @_;
- (find { $authentication->{$_} } authentication_kinds()) || 'local';
-}
-
-sub ask_authentification_parameters {
- my ($in, $netc, $authentication, $authentication_kind) = @_;
-
- my $val = $authentication->{$authentication_kind};
-
- if ($authentication_kind eq 'LDAP') {
- $val ||= 'ldap.' . $netc->{DOMAINNAME};
- $netc->{LDAPDOMAIN} ||= join(',', map { "dc=$_" } split /\./, $netc->{DOMAINNAME});
- $in->ask_from('',
- N("Authentication LDAP"),
- [ { label => N("LDAP Base dn"), val => \$netc->{LDAPDOMAIN} },
- { label => N("LDAP Server"), val => \$val },
- ]) or return;
- } elsif ($authentication_kind eq 'NIS') {
- $val ||= 'broadcast';
- $in->ask_from('',
- N("Authentication NIS"),
- [ { label => N("NIS Domain"), val => \ ($netc->{NISDOMAIN} ||= $netc->{DOMAINNAME}) },
- { label => N("NIS Server"), val => \$val, list => ["broadcast"], not_edit => 0 },
- ]) or return;
- } elsif ($authentication_kind eq 'winbind') {
- #- maybe we should browse the network like diskdrake --smb and get the 'doze server names in a list
- #- but networking isn't setup yet necessarily
- $in->ask_warn('', N("For this to work for a W2K PDC, you will probably need to have the admin run: C:\\>net localgroup \"Pre-Windows 2000 Compatible Access\" everyone /add and reboot the server.\nYou will also need the username/password of a Domain Admin to join the machine to the Windows(TM) domain.\nIf networking is not yet enabled, Drakx will attempt to join the domain after the network setup step.\nShould this setup fail for some reason and domain authentication is not working, run 'smbpasswd -j DOMAIN -U USER%%PASSWORD' using your Windows(tm) Domain, and Admin Username/Password, after system boot.\nThe command 'wbinfo -t' will test whether your authentication secrets are good."));
- $in->ask_from('',
- N("Authentication Windows Domain"),
- [ { label => N("Windows Domain"), val => \ ($netc->{WINDOMAIN} ||= $netc->{DOMAINNAME}) },
- { label => N("Domain Admin User Name"), val => \$val },
- { label => N("Domain Admin Password"), val => \$authentication->{winpass}, hidden => 1 },
- ]) or return;
- }
- #- keep only one authentication
- delete $authentication->{$_} foreach authentication_kinds();
- $authentication->{$authentication_kind} = $val;
- 1;
-}
-
-sub set_authentication {
- my ($in, $netc, $authentication, $when_network_is_up) = @_;
- my ($shadow, $ldap, $nis, $winbind, $winpass) = @$authentication{qw(shadow LDAP NIS winbind winpass)};
- enableShadow() if $shadow;
- if ($ldap) {
- $in->do_pkgs->install(qw(chkauth openldap-clients nss_ldap pam_ldap autofs));
- run_program::rooted($::prefix, "/usr/sbin/chkauth", "ldap", "-D", $netc->{LDAPDOMAIN}, "-s", $ldap);
- } elsif ($nis) {
- #$o->pkg_install(qw(chkauth ypbind yp-tools net-tools));
- #run_program::rooted($::prefix, "/usr/sbin/chkauth", "yp", $domain, "-s", $nis);
- $in->do_pkgs->install("ypbind");
- my $domain = $netc->{NISDOMAIN};
- $domain || $nis ne "broadcast" or die \N("Can't use broadcast with no NIS domain");
- my $t = $domain ? "domain $domain" . ($nis ne "broadcast" && " server") : "ypserver";
- substInFile {
- $_ = "#~$_" unless /^#/;
- $_ .= "$t $nis\n" if eof;
- } "$::prefix/etc/yp.conf";
- require network::network;
- network::network::write_conf("$::prefix/etc/sysconfig/network", $netc);
-
- $when_network_is_up->(sub {
- run_program::rooted($::prefix, 'nisdomainname', $domain);
- run_program::rooted($::prefix, 'service', 'ypbind', 'restart');
- }) if !$::isInstall; #- TODO: also do it during install since nis can be useful to resolve domain names. Not done because 9.2-RC
- } elsif ($winbind) {
- my $domain = $netc->{WINDOMAIN};
- $domain =~ tr/a-z/A-Z/;
-
- $in->do_pkgs->install(qw(samba-winbind samba-common));
- { #- setup pam
- my $f = "$::prefix/etc/pam.d/system-auth";
- cp_af($f, "$f.orig");
- cp_af("$f-winbind", $f);
- }
- require network::smb;
- network::smb::write_smb_conf($domain);
- run_program::rooted($::prefix, "chkconfig", "--level", "35", "winbind", "on");
- mkdir_p("$::prefix/home/$domain");
-
- #- defer running smbpassword until the network is up
- $when_network_is_up->(sub {
- run_program::rooted($::prefix, "/usr/bin/smbpasswd", "-j", $domain, "-U", $winbind . "%" . $winpass);
- });
- }
-}
-
1;