diff options
author | Stew Benedict <stewb@mandriva.org> | 2002-07-18 19:21:29 +0000 |
---|---|---|
committer | Stew Benedict <stewb@mandriva.org> | 2002-07-18 19:21:29 +0000 |
commit | 76400d0960607e02acb13f0b4a10fde59bce15b1 (patch) | |
tree | 24b0ed1a008b0822ed7dfde770ca896f2752e5e2 /perl-install/install_any.pm | |
parent | bf5c1abc529fb5c9858f7652b66157ae09152708 (diff) | |
download | drakx-76400d0960607e02acb13f0b4a10fde59bce15b1.tar drakx-76400d0960607e02acb13f0b4a10fde59bce15b1.tar.gz drakx-76400d0960607e02acb13f0b4a10fde59bce15b1.tar.bz2 drakx-76400d0960607e02acb13f0b4a10fde59bce15b1.tar.xz drakx-76400d0960607e02acb13f0b4a10fde59bce15b1.zip |
add support/option for Windows(tm) authentication via winbind
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index ab89918d6..0196e293a 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -436,7 +436,7 @@ sub addToBeDone(&$) { sub setAuthentication { my ($o) = @_; - my ($shadow, $md5, $ldap, $nis) = @{$o->{authentication} || {}}{qw(shadow md5 LDAP NIS)}; + my ($shadow, $md5, $ldap, $nis, $winbind) = @{$o->{authentication} || {}}{qw(shadow md5 LDAP NIS winbind)}; my $p = $o->{prefix}; #- obsoleted always enabled (in /etc/pam.d/system-auth furthermore) #any::enableMD5Shadow($p, $shadow, $md5); any::enableShadow($p) if $shadow; @@ -457,9 +457,54 @@ sub setAuthentication { } "$p/etc/yp.conf"; require network; network::write_conf("$p/etc/sysconfig/network", $o->{netc}); + } elsif ($winbind) { + my $domain = $o->{netc}{WINDOMAIN}; + $o->pkg_install(qw(samba-winbind samba-common)); + { #- setup pam + my $f = "$o->{prefix}/etc/pam.d/system-auth"; + cp_af($f, "$f.orig"); + cp_af("$f-winbind", $f); + } + write_smb_conf($o, $domain); + run_program::rooted($o->{prefix}, "chkconfig", "--level", "35", "winbind", "on"); + mkdir "$o->{prefix}/home/$domain", 0755; + + #- finally join the machine to the Windoze domain + run_program::rooted($o->{prefix}, "/usr/bin/smbpasswd", "-j", $domain, "-r", $winbind); } } +sub write_smb_conf { + my ($domain) = @_; + + #- was going to just have a canned config in samba-winbind + #- and replace the domain, but sylvestre/buchan didn't bless it yet + + my $f = "$::prefix/etc/samba/smb.conf"; + rename $f, "$f.orig"; + output($f, " +[global] + workgroup = $domain + server string = Samba Server %v + security = domain + encrypt passwords = Yes + password server = * + log file = /var/log/samba/log.%m + max log size = 50 + socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 + character set = ISO8859-15 + os level = 18 + local master = No + dns proxy = No + winbind uid = 10000-20000 + winbind gid = 10000-20000 + winbind separator = + + template homedir = /home/%D/%U + template shell = /bin/bash + winbind use default domain = yes +"); +} + sub killCardServices { my $pid = chomp_(cat_("/tmp/cardmgr.pid")); $pid and kill(15, $pid); #- send SIGTERM |