summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <nvigier@mandriva.com>2008-03-05 16:34:38 +0000
committerNicolas Vigier <nvigier@mandriva.com>2008-03-05 16:34:38 +0000
commit1ea920072c09c49c019188e7d30b7fca1e6e8391 (patch)
tree433600c92ac24c915f53e9bd981e19cbcc965c5f
parentde522045836b90f9067ebbd04ee2895e3c5e7e11 (diff)
downloaddrakwizard-1ea920072c09c49c019188e7d30b7fca1e6e8391.tar
drakwizard-1ea920072c09c49c019188e7d30b7fca1e6e8391.tar.gz
drakwizard-1ea920072c09c49c019188e7d30b7fca1e6e8391.tar.bz2
drakwizard-1ea920072c09c49c019188e7d30b7fca1e6e8391.tar.xz
drakwizard-1ea920072c09c49c019188e7d30b7fca1e6e8391.zip
remove and don't install disabled wizards so that mcc doesn't offer to run them
-rw-r--r--Makefile10
-rw-r--r--installsrv_wizard/.perl_checker1
-rw-r--r--installsrv_wizard/Installsrv.pm168
-rw-r--r--installsrv_wizard/Makefile10
-rw-r--r--kolab_wizard/.perl_checker1
-rwxr-xr-xkolab_wizard/Kolab.pm275
-rw-r--r--kolab_wizard/Makefile10
-rw-r--r--ldap_wizard/.perl_checker1
-rw-r--r--ldap_wizard/Ldap.pm442
-rw-r--r--ldap_wizard/images/ldap.pngbin5603 -> 0 bytes
-rw-r--r--ldap_wizard/ldapdef.pm108
-rw-r--r--news_wizard/.perl_checker1
-rwxr-xr-xnews_wizard/Inn.pm160
-rw-r--r--news_wizard/Makefile29
-rwxr-xr-xnews_wizard/scripts/check_news_server.sh48
-rwxr-xr-xnews_wizard/scripts/check_valid_hours.sh49
-rw-r--r--news_wizard/scripts/config.default116
-rwxr-xr-xnews_wizard/scripts/do_it_news.sh86
-rw-r--r--news_wizard/scripts/news.cron10
-rw-r--r--nfs_wizard/.perl_checker1
-rw-r--r--nfs_wizard/Makefile13
-rwxr-xr-xnfs_wizard/NFS.pm166
-rw-r--r--nfs_wizard/images/IC-NFS-48.pngbin2643 -> 0 bytes
-rw-r--r--nfs_wizard/nfs.wiz291
-rw-r--r--nfs_wizard/scripts/NFSConf.pm67
-rwxr-xr-xnfs_wizard/scripts/do_it_nfs.sh52
-rw-r--r--nisautofs_wizard/.perl_checker1
-rw-r--r--nisautofs_wizard/Makefile8
-rw-r--r--nisautofs_wizard/Nisautofs.pm319
-rw-r--r--postfix_wizard/.perl_checker1
-rw-r--r--postfix_wizard/Makefile21
-rwxr-xr-xpostfix_wizard/Postfix.pm404
-rw-r--r--postfix_wizard/postfix_main.txt64
-rw-r--r--postfix_wizard/postfix_relais.txt44
-rw-r--r--postfix_wizard/scripts/Postfixconf.pm93
-rwxr-xr-xpostfix_wizard/scripts/check_masquerade.sh53
-rwxr-xr-xpostfix_wizard/scripts/check_relay.sh50
-rwxr-xr-xpostfix_wizard/scripts/compute_mail_relay.sh41
-rwxr-xr-xpostfix_wizard/scripts/compute_masquerade.sh41
-rw-r--r--postfix_wizard/scripts/main.cf.dist.default640
-rwxr-xr-xpostfix_wizard/scripts/postfix_do_it.sh103
-rw-r--r--postfix_wizard/scripts/testlabel.pl15
-rw-r--r--samba_wizard/.perl_checker1
-rw-r--r--samba_wizard/Makefile12
-rwxr-xr-xsamba_wizard/Samba.pm490
-rwxr-xr-xsamba_wizard/Sambaprint.pm304
-rwxr-xr-xsamba_wizard/Sambashare.pm976
-rw-r--r--samba_wizard/images/IC-sambaprt-48.pngbin1915 -> 0 bytes
-rw-r--r--samba_wizard/images/IC-sambashare-48.pngbin2988 -> 0 bytes
-rw-r--r--samba_wizard/images/sambasrv.pngbin3511 -> 0 bytes
-rw-r--r--samba_wizard/scripts/smb.conf.default524
51 files changed, 1 insertions, 6319 deletions
diff --git a/Makefile b/Makefile
index bfc78cec..315f7445 100644
--- a/Makefile
+++ b/Makefile
@@ -10,19 +10,11 @@ PERL_VENDORLIB=$(shell eval "`perl -V:installvendorlib`"; installvendorlib=$${in
WIZ = dhcp_wizard\
dns_wizard\
- postfix_wizard\
- samba_wizard\
time_wizard\
web_wizard\
ftp_wizard\
- news_wizard\
proxy_wizard\
- nisautofs_wizard \
- installsrv_wizard \
- nfs_wizard \
- sshd_wizard \
- kolab_wizard \
- ldap_wizard
+ sshd_wizard
OTHER = data\
po
diff --git a/installsrv_wizard/.perl_checker b/installsrv_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/installsrv_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/installsrv_wizard/Installsrv.pm b/installsrv_wizard/Installsrv.pm
deleted file mode 100644
index 3ea0dd7a..00000000
--- a/installsrv_wizard/Installsrv.pm
+++ /dev/null
@@ -1,168 +0,0 @@
-# version 0.2
-#
-# Copyright (C) 2004 Mandrakesoft
-#
-# Author: aginies _at_ mandrakesoft.com
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-package MDK::Wizard::Installsrv;
-use lib qw(/usr/lib/libDrakX);
-#use ugtk2 qw(:ask :helpers :wrappers :create :dialogs);
-use strict;
-use standalone;
-use common;
-use services;
-use MDK::Wizard::Varspaceval;
-use MDK::Wizard::Wizcommon;
-use MDK::Wizard::Wizcommon_gtk2;
-
-
-# test root capa
-my $wiz = new MDK::Wizard::Wizcommon;
-
-my $INSTALLDIR = "/var/install/";
-my $NFSEXPORTS = "/etc/exports";
-my $WWWDIR = "/var/www/html";
-my $testy;
-
-my $o = {
- name => 'Install Server Wizard',
- var => {
- DESTDIR => '/var/install/clic',
- SOURCEDIR => '/home/nis/install/clic',
- },
- needed_rpm => [ 'nfs-utils', 'apache-mpm-prefork' ],
- defaultimage => "$ENV{__WIZ_HOME__}/installsrv_wizard/images/Install.png"
- };
-
-$o->{pages} = {
- welcome => {
- name => N("Configure an install server (via NFS and HTTP)") . "\n\n" . N("Easily configure a server installation directory, with NFS and HTTP access."),
- no_back => 1,
- next => 'install_srv',
- },
- install_srv => {
- name => N("Install server configuration") . "\n\n" . N("Path to data: specify your source directory, should be base of a Linux installation.") . "\n\n" . N("Destination directory: copy files in which directory?"),
- pre => sub {
- $o->{var}{wiz_nfs} ||= 1;
- $o->{var}{wiz_http} ||= 1;
- },
- data => [
- { label => "Path to data:", val => \$o->{var}{SOURCEDIR}, help => N("Please provide path to Mandriva installation disk") },
- { label => "Destination directory:", val => \$o->{var}{DESTDIR}, help => N("Files will be copied in this place.") },
-# { label => N("Enable NFS install server:"), type => 'bool', val => \$o->{var}{wiz_nfs} },
-# { label => N("Enable HTTP install server:"), type => 'bool', val => \$o->{var}{wiz_http} },
- ],
- post => \&test_data,
- next => 'summary_srv',
- },
- error_dir_dest => {
- name => N("The destination directory could not be '/var/install/'") . "\n\n" . N("ie use: /var/install/mdk-release"),
- next => 'install_srv',
- },
- error_dir => {
- name => N("Error, the source path must be a directory with full Linux installation directory."),
- next => 'install_srv',
- },
- dir_already_use => {
- name => N("The destination directory is already in use. Please choose another one."),
- next => 'install_srv',
- },
- summary_srv => {
- name => N("Your install server will be configured with these parameters"),
- pre => sub {
- $o->{var}{nfs} = $o->{var}{wiz_nfs} ? N("enabled") : N("disabled");
- $o->{var}{http} = $o->{var}{wiz_http} ? N("enabled") : N("disabled");
- },
- data => [
- { label => "Path to data:", val_ref => \$o->{var}{SOURCEDIR} },
- { label => "Destination directory:", val_ref => \$o->{var}{DESTDIR} },
- { label => N("Enable NFS install server:"), val_ref => \$o->{var}{nfs} },
- { label => N("Enable HTTP install server:"), val_ref => \$o->{var}{http} },
- ],
- post => \&do_it,
- no_back => 1,
- next => 'end',
- },
- wait => {
- name => N("Configuring your system, please wait..."),
- next => 'end',
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Please Relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
- end => {
- name => N("Congratulations, Install server is now ready. You can now configure a DHCP server with PXE support, and a PXE server. So it will be very easy to install Linux through a network. Use drakpxelinux to configure your PXE server, and drakwizard DHCP to configure a DHCPD server."),
- end => 1,
- no_back => 1,
- next => 0
- },
- };
-
-
-sub add_install_dir {
- if (any { /$o->{var}{DESTDIR}/ } cat_($NFSEXPORTS)) {
- print " - " . $NFSEXPORTS . " ready\n";
- } else {
- append_to_file($NFSEXPORTS, "$o->{var}{DESTDIR} *(async,rw,no_root_squash)\n");
- check_started("nfs");
- system("service nfs reload");
- }
-}
-
-sub test_data {
- -d $o->{var}{SOURCEDIR} && -f "$o->{var}{SOURCEDIR}/VERSION" or return 'error_dir';
- if ($o->{var}{DESTDIR} eq $INSTALLDIR) { return 'error_dir_dest' }
- if (-e $o->{var}{DESTDIR}) { return 'dir_already_use' }
-}
-
-sub add_ftpuser {
- system("/usr/sbin/useradd -u 12383 -d install -r -s /bin/bash install");
-}
-
-sub add_http_link {
- my ($PATH) = @_;
- my $LINK = $WWWDIR . '/' . basename($PATH);
- if (! -f $LINK) {
- symlink $PATH, $LINK;
- }
- check_started("httpd");
-}
-
-sub do_it {
- return if $::testing;
- my $S = $o->{var}{SOURCEDIR};
- my $D = $o->{var}{DESTDIR};
- if (! -d $D) { mkdir_p($D) }
- my $command = "cp -av $S/* $D";
- MDK::Wizard::Wizcommon_gtk2::gtk_log($command, "Copying Data...");
-
- add_install_dir();
- add_http_link($o->{var}{DESTDIR});
- return 'end';
-}
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-1;
diff --git a/installsrv_wizard/Makefile b/installsrv_wizard/Makefile
deleted file mode 100644
index 5a33958c..00000000
--- a/installsrv_wizard/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/installsrv_wizard
- install --mode=u=rwx,g=rx,o=rx -p ftp.wiz ${prefix}/share/wizards/installsrv_wizard
- install --mode=a=r -p ./images/Install.png ${prefix}/share/wizards/installsrv_wizard/images
-
diff --git a/kolab_wizard/.perl_checker b/kolab_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/kolab_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/kolab_wizard/Kolab.pm b/kolab_wizard/Kolab.pm
deleted file mode 100755
index d07b13b7..00000000
--- a/kolab_wizard/Kolab.pm
+++ /dev/null
@@ -1,275 +0,0 @@
-#!/usr/bin/perl
-#
-# Drakwizard
-# Copyright (C) 2003 Florent Villard <warly@mandrakesoft.com>
-# Copyright (C) 2004 Antoine Ginies <aginies -ateu_ mandrakesoft.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Kolab;
-use strict;
-use common;
-use MDK::Wizard::IFCFG;
-use MDK::Wizard::Wizcommon;
-use MDK::Wizard::Wizcommon_gtk2;
-
-
-my $wiz = new MDK::Wizard::Wizcommon;
-
-my $HOSTNAME = chomp_(`hostname`);
-my $IPSERVER = $wiz->{net}->itf_get("IPADDR");
-if (!$IPSERVER) {
- my $interface = 'eth0';
- ($IPSERVER) = `/sbin/ip addr show dev $interface` =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/m;
-}
-my $DOMAINNAME = chomp_(`dnsdomainname`);
-#my $kolab_config = "/etc/kolab/kolab.conf";
-my $CAYESORNO;
-
-my $o = {
- name => N("Kolab configuration wizard"),
- init => sub {
- my ($err, $msg) = test_host_domain($SHORTHOSTNAME, $DOMAINNAME);
- if (!$err) {
- $in->ask_warn(N('Error'), $msg);
- die 'wizcancel';
- }
- },
- var => {
- hostname => $HOSTNAME,
- ip1 => $IPSERVER,
- domain => $DOMAINNAME,
- password => '',
- capasswd => '',
- keypasswd => '',
- },
- needed_rpm => [ 'proftpd', 'openldap-servers', 'kolab' ],
- # defaultimage => /usr/share/wizards/,
- };
-$::Wizard_pix_up = "/usr/share/mcc/themes/default/kolab-mdk.png";
-
-my %type = (
- 1 => N("Master kolab server"),
-# 2 => N("Slave kolab server"),
- );
-
-$o->{pages} = {
- welcome => {
- name => N("Welcome to the Kolab Groupware server configuration Wizard.") . "\n\n" . N("Kolab is a secure, scalable and reliable groupware server. Some of the major features include: a web administration interface, a shared address book with provision for mailbox users as well as contacts and a POP3 as well as IMAP4(rev1) access to mail") . "\n\n" . N("Warning: Kolab needs to configure many other services: Proftpd, LDAP, Cyrus, Postfix, Imap, Saslauth. Wizard will make a backup of all your previous configuration files for these services."),
- no_back => 1,
- next => 'masterslave',
- },
- masterslave => {
- name => N("Master or slave Kolab server"),
- post => sub {
- if ($o->{var}{wiz_type} == 1) {
- $o->{var}{masterslave} = "1";
- return 'slaveserver';
- } else {
- $o->{var}{masterslave} = "2";
- return 'domain';
- }
- },
- data => [
- { label => "", val => \$o->{var}{wiz_type}, type => 'list', list => [ sort keys %type ], format => sub { $type{$_[0]} } },
- ],
- },
- master => {
- name => N("You choose a Master Kolab server"),
- next => 'slaveserver',
- },
- slaveserver => {
- name => N("You choose to configure a master Kolab server.") . "\n\n" . N("Enter fully qualified hostname of slave kolab server e.g. thishost.domain.tld (leave empty if none)."),
- data => [
- { label => N("Slave kolab server:"), val => \$o->{var}{slaveserver} },
- ],
- next => 'domain',
- no_back => 1,
- },
- domain => {
- name => N("Kolab Domain") . "\n\n" . N("Please enter your Maildomain - if you do not know your mail domain use the FQDN from above. Kolab primary email addresses will be of the type user\@yourdomain"),
- pre => sub {
- $o->{var}{domain} = $DOMAINNAME;
- },
- data => [
- { label => N("Domain:"), val => \$o->{var}{domain} },
- ],
- next => 'password',
- complete => sub {
- if (!$o->{var}{domain}) {
- $::in->ask_warn(N("Error"), N("You need a Kolab domain"));
- return 1;
- } else { return 0 }
- },
- },
- password => {
- name => N("Enter password for the 'manager' account of Kolab server."),
- complete => sub {
- if ($o->{var}{password} ne $o->{var}{password2} || $o->{var}{password} eq "") {
- $::in->ask_warn(N("Error:"), N("Password mismatch, or null password, please correct."));
- return 1;
- }
- },
- data => [
- { label => N("Password:"), val => \$o->{var}{password}, hidden => 1 },
- { label => N("Password again:"), val => \$o->{var}{password2}, hidden => 1 },
- ],
- next => 'organame',
- },
- organame => {
- name => N("Enter organisation name and organisational unit"),
- pre => sub {
- $o->{var}{wiz_organame} = "kolab";
- $o->{var}{wiz_orgaunit} = "Test_CA";
- },
- data => [
- { label => N("Organisation name:"), val => \$o->{var}{wiz_organame} },
- { label => N("Organisational unit:"), val => \$o->{var}{wiz_orgaunit} },
- ],
- complete => sub {
- if (!$o->{var}{wiz_orgaunit} || !$o->{var}{wiz_organame}) {
- $::in->ask_warn(N("Error"), N("You need to enter an Organisation name and an organisational unit"));
- return 1;
- } else { return 0 }
- },
- next => 'summary',
- },
- cayesorno => {
- name => N("Kolab can create and manage a certificate authority that can be used to create SSL certificates for use within the Kolab environment.") . "\n\n" . N("You can choose to skip this section if you already have certificates for the Kolab server."),
- post => sub {
- if ($o->{var}{cayesorno}) {
- $CAYESORNO = "y";
- return 'capassword';
- } else {
- $CAYESORNO = "n";
- return 'summary_noca';
- }
- },
- pre => sub {
- $o->{var}{cayesorno} = 1;
- },
- data => [
- { label => "Do you want to create CA and certificates:", type => 'bool', val => \$o->{var}{cayesorno} },
- ],
- },
- capassword => {
- name => N("Kolab can create and manage a certificate authority that can be used to create SSL certificates for use within the \Kolab environment. Enter the passphrase for CA, and the passphrase for the RSA key."),
- complete => sub {
- if ($o->{var}{capasswd} ne $o->{var}{capasswd2} || $o->{var}{capasswd} eq "") {
- $::in->ask_warn(N("Error:"), N("Password mismatch, or null password, please correct."));
- return 1;
- }
- if ($o->{var}{keycapasswd} ne $o->{var}{keycapasswd2} || $o->{var}{keycapasswd} eq "") {
- $::in->ask_warn(N("Error:"), N("Password mismatch, or null password, please correct."));
- return 1;
- }
- },
- pre => sub {
- foreach ($o->{var}{capasswd}, $o->{var}{capasswd2}, $o->{var}{keycapasswd}, $o->{var}{keycapasswd2}) {
- $_ = "rrrrrrrrrr";
- }
- },
- data => [
- { label => N("CA passphrase:"), val => \$o->{var}{capasswd}, hidden => 1 },
- { label => N("CA passphrase again:"), val => \$o->{var}{capasswd2}, hidden => 1 },
- { label => ' ', },
- { label => N("RSA key passphrase:"), val => \$o->{var}{keycapasswd}, hidden => 1 },
- { label => N("RSA key passphrase:"), val => \$o->{var}{keycapasswd2}, hidden => 1 },
- ],
- next => 'summary',
- },
- summary => {
- name => N("The wizard will now configure Kolab server with these parameters"),
- data => [
- { label => N("Hostname:"), fixed_val => \$o->{var}{hostname} },
- { label => N("Domain:"), fixed_val => \$o->{var}{domain} },
- { label => "" },
- { label => N("Organisation name:"), fixed_val => \$o->{var}{wiz_organame} },
- { label => N("Organisationnal unit:"), fixed_val => \$o->{var}{wiz_orgaunit} },
- { label => N("With CA") },
- ],
- post => \&do_it_master,
- next => 'end',
- },
- summary_noca => {
- name => N("The wizard will now configure Kolab server with these parameters"),
- data => [
- { label => N("Hostname:"), fixed_val => \$o->{var}{hostname} },
- { label => N("Domain:"), fixed_val => \$o->{var}{domain} },
- { label => "" },
- { label => N("Organisation name:"), fixed_val => \$o->{var}{wiz_organame} },
- { label => N("Organisationnal unit:"), fixed_val => \$o->{var}{wiz_orgaunit} },
- ],
- post => \&do_it_master_withoutca,
- next => 'end',
- },
- end => {
- name => N("Done") . "\n\n" . N("The kolab server is now configured. Log in as 'manager' with the password you entered at https://127.0.0.1/kolab/admin/"),
- end => 1,
- next => 0,
- },
- };
-
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-sub do_it_master_withoutca {
- return if $::testing;
- my $in = 'interactive'->vnew('su', 'Kolab server');
- my $w = $in->wait_message(N("Kolab server"), N("Configuring Kolab server on your system..."));
-}
-
-sub do_it_master {
- return if $::testing;
- my $oldconf;
- -f "/etc/kolab/.kolab2_configured" and $oldconf = "y";
- MDK::Wizard::Wizcommon_gtk2::gtk_log("service kolab stop", "Kolab stop...");
- my $in = 'interactive'->vnew('su', 'Kolab server');
- my $w = $in->wait_message(N("Kolab server"), N("Configuring Kolab server on your system..."));
-
- system("rm -rf /etc/kolab/*.pem");
- system("rm -rf /etc/kolab/*.kolabtmp");
- system("rm -rf /etc/kolab/ca/*");
-
- substInFile {
- s|\$REQ -new -x509 -keyout \${CATOP}/private/\$CAKEY.*|\$REQ -new -x509 -keyout \${CATOP}/private/\$CAKEY -passout pass\:\$PASSKOLAB \\|;
- s|\$CA -policy policy_anything.*|\$CA -policy policy_anything -batch -out \${outfile} -passin pass\:\$PASSKOLAB -infiles \${infile}|;
- } "/etc/kolab/kolab_ca.sh";
-
- $ENV{PASSKOLAB} = $o->{var}{password};
-
- my $F;
- open($F, "|/usr/sbin/kolab_bootstrap -b\n");
- print $F "$oldconf
-$o->{var}{hostname}
-$o->{var}{masterslave}
-$o->{var}{domain}
-$o->{var}{password}
-$o->{var}{slaveserver}
-$CAYESORNO
-$o->{var}{wiz_organame}
-$o->{var}{wiz_orgaunit}
-
-y
-";
- close $F;
- undef $w;
- MDK::Wizard::Wizcommon_gtk2::gtk_log("service kolab start", "Kolab start...");
-}
-
-1;
diff --git a/kolab_wizard/Makefile b/kolab_wizard/Makefile
deleted file mode 100644
index f2dfed38..00000000
--- a/kolab_wizard/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-install2:
- su -c 'make install'
-
-clean:
- rm -rf *~
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/kolab_wizard/images
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard
- install --mode=u=rw,g=r,o=r -p *.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/
-# install --mode=a=r -p ./images/*.png ${prefix}/share/wizards/kolab_wizard/images
diff --git a/ldap_wizard/.perl_checker b/ldap_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/ldap_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm
deleted file mode 100644
index 19d2031b..00000000
--- a/ldap_wizard/Ldap.pm
+++ /dev/null
@@ -1,442 +0,0 @@
-#!/usr/bin/perl
-# version 1.35
-# GPL like
-# vguardiola@mandrakesoft.com
-
-package MDK::Wizard::Ldap;
-use lib qw(/usr/lib/libDrakX);
-use ugtk2 qw(:create);
-use strict;
-use MDK::Wizard::ldapdef;
-use interactive;
-use services;
-use common;
-use standalone;
-use MDK::Wizard::Varspaceval;
-use MDK::Wizard::Wizcommon;
-use Expect;
-require Net::LDAP;
-use Net::LDAP::Util qw(ldap_error_text);
-
-
-#unless ($> == 0) {
-# die "You are not root Exiting\n";
-#}
-
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-my $wiz_domain_name = $wiz->{net}->network_get("DOMAINNAME");
-my $wiz_host_name = $wiz->{net}->network_get("HOSTNAME");
-my $DOMAINNAME = chomp_(`domainname`);
-
-my $o = {
- name => N("Ldap wizard"),
- var => {
- defou => 'ou=People',
- srv => 'localhost',
- suffix => '',
- rootdn => '',
- rootpass => '',
- rootpass2 => '',
- cn => '',
- sn => '',
- uid => '',
- uidpass => '',
- lshell => '/bin/bash',
- home => '/home/',
- uidnb => '1004',
- gidnb => '1004',
- container => 'container',
- objectclass => 'top,account,posixaccount',
- shadowmax => '99999',
- shadowmin => '-1',
- plop => '',
- tmp => '',
- nom => '',
- prenom => '',
- },
- needed_rpm => [ 'openldap-servers', 'openldap-clients', 'nss_ldap' ],
- defaultimage => "/usr/share/mcc/themes/default/ldap-mdk.png",
- init => sub {
- my ($err, $msg) = test_host_domain($SHORTHOSTNAME, $DOMAINNAME);
- if (!$err) {
- $in->ask_warn(N('Error'), $msg);
- die 'wizcancel';
- }
- }
- };
-
-my $ldap_suffix=join(',dc=', split(/\./, 'dc=' . chomp_(`hostname -f`)));
-$ldap_suffix =~ s/[^,]*,//;
-my $conf_file = "/etc/sysconfig/ldapwiz";
-my $LDAPCONF = "/etc/openldap/slapd.conf";
-#my $rootdn_cn = "Admin";
-##### Read conf file is exist
-
-my $hostname = `hostname`;
-$o->{var}{srv} = $hostname;
-
-if (-f $conf_file) {
- my %conf = getVarsFromSh($conf_file);
- $o->{var}{suffix} = $conf{suffix};
- $o->{var}{rootdn} = $conf{rootdn};
- $o->{var}{srv} = $conf{srv};
- $o->{var}{defou} = $conf{users};
- $o->{var}{rootpass} = $conf{rootpass};
-} else {
- my $hostname = chomp_(`hostname`);
- $o->{var}{srv} = $hostname;
- $o->{var}{suffix} = $ldap_suffix;
-}
-
-my %level = (
- 1 => N("Show Ldap configuration"),
- 2 => N("Add user in Ldap server"),
- 3 => N("Delete Ldap configuration"),
- );
-
-$o->{pages} = {
- welcome => {
- name => N("Ldap configuration wizard") . "\n\n" . N("LDAP stands for Lightweight Directory Access Protocol.") . "\n\n" . N("It is a lightweight protocol for accessing directory services, specifically X.500-based directory services."),
- no_back => 1,
- post => sub {
- ! -f $conf_file and 'set_srv';
- },
- next => 'ask_menu',
- },
- ask_menu => {
- name => N("Ldap configuration wizard"),
- no_back => 1,
- pre => sub {
- $o->{var}{wiz_level} ||= 1;
- },
- post => sub {
- if ($o->{var}{wiz_level} == 2) {
- ! -f $conf_file and $in->ask_warn(N("Error"), N("You must setup an Ldap server first.")) and return 'set_srv';
- return 'add_userposix';
- }
- if ($o->{var}{wiz_level} == 1) {
- -f $conf_file and return 'resume';
- }
- if ($o->{var}{wiz_level} == 3) {
- ! -f $conf_file and $in->ask_warn(N("Error"), N("You must setup an Ldap server first.")) and return 'set_srv';
- return 'del_conf';
- }
- },
- data => [
- { label => " " },
- { label => N("Your choice:") . "\n\n", val => \$o->{var}{wiz_level}, type => 'list', list => [ keys %level ], format => sub { $level{$_[0]} } },
- ],
- next => 'set_srv',
- },
- del_conf => {
- name => N("Delete configuration") . "\n\n" . N("Saving existing base in /root/ldap-sav.ldiff"),
- post => \&sav_conf,
- next => 'welcome',
- },
- add_userposix => {
- name => N("LDAP Adding User"),
- data => [
- #{ label => " " },
- { label => N("User Created in: %s, %s", $o->{var}{defou}, $o->{var}{suffix}) },
- { label => "" },
- { label => N("First Name:"), val => \$o->{var}{sn} },
- { label => N("Name:"), val => \$o->{var}{cn} },
- { label => N("User Login:"), val => \$o->{var}{uid} },
- ],
- complete => sub {
- if (!$o->{var}{sn}) {
- $in->ask_warn(N("Error"), N("You must enter a valid First Name."));
- return 1;
- }
- if (!$o->{var}{cn}) {
- $in->ask_warn(N("Error"), N("You must enter a valid Name."));
- return 1;
- }
- if (!$o->{var}{uid}) {
- $in->ask_warn(N("Error"), N("You must enter a valid User Name."));
- return 1;
- }
- },
- next => 'password',
- },
- password => {
- name => N("LDAP User Password"),
- data => [
- { label => "" },
- { label => N("Password:"), val => \$o->{var}{uidpass}, hidden => 1, help => N("passwords must match") },
- { label => N("Password (again):"), val => \$o->{var}{uidpass2}, hidden => 1, help => N("passwords must match") },
- ],
- complete => sub {
- if (!$o->{var}{uidpass}) {
- $in->ask_warn(N("Error"), N("You must enter a password for LDAP."));
- $o->{var}{uidpass} = "";
- return 1;
- }
- if ($o->{var}{uidpass} ne $o->{var}{uidpass2}) {
- $in->ask_warn(N("Error"), N("The passwords do not match"));
- $o->{var}{uidpass} = "";
- $o->{var}{uidpass2} = "";
- return 1;
- }
- },
- next => 'summary_add_user',
- },
- set_srv => {
- name => N("Configuring LDAP Server") . "\n\n" . N("LDAP directory tree") . "\n" . N("The DNS naming is used for LDAP directory tree definition") . "\n" . N("Domain name: %s", $wiz_domain_name) . "\n" . ("LDAP Diretory Tree: %s", $o->{var}{suffix}) . "\n\n" . N("LDAP Administrator") . "\n" . N("Administrator is a power user with grant access on LDAP database") . "\n" . "cn=" . N("Administrator,%s", $o->{var}{suffix}) . "\n\n",
- data => [
- { label => " " },
- { label => N("LDAP directory tree:"), val => \$o->{var}{suffix} },
- { label => N("LDAP Administrator:"), val => \$o->{var}{rootdn} },
- { label => N("LDAP Password:"), hidden => 1, val => \$o->{var}{rootpass} },
- { label => N("LDAP Password (again):"), hidden => 1, val => \$o->{var}{rootpass2} },
- ],
- pre => sub {
- $o->{var}{rootdn} = "cn=" . N("Administrator,%s", $o->{var}{suffix});
- my $_cryptpass = crypt($o->{var}{rootpass}, "crypt");
-# $o->{var}{rootpass} = $_cryptpass;
- },
- complete => sub {
- if (!$o->{var}{suffix} || $o->{var}{suffix} !~ /dc/) {
- $in->ask_warn(N("Error"), N("You must enter a valid LDAP directory tree."));
- return 1;
- }
- if (!$o->{var}{rootpass}) {
- $in->ask_warn(N("Error"), N("You must enter a password for LDAP."));
- $o->{var}{rootpass} = "";
- return 1;
- }
- if ($o->{var}{rootpass} ne $o->{var}{rootpass2}) {
- $in->ask_warn(N("Error"), N("The passwords do not match"));
- $o->{var}{rootpass} = "";
- $o->{var}{rootpass2} = "";
- return 1;
- }
- #$o->{var}{rootdn} = "cn=".$rootdn_cn.$o->{var}{suffix},
- },
- next => 'summary_set_srv',
- },
- summary_add_user => {
- name => N("Confirmation of the user to create"),
- data => [
- { label => " " },
- { label => N("Name:"), type => 'field', val_ref => \$o->{var}{cn} },
- { label => N("First name:"), type => 'field', val_ref => \$o->{var}{sn} },
- { label => N("User Name:"), type => 'field', val_ref => \$o->{var}{uid} },
- { label => N("Create in:"), type => 'field', val_ref => \$o->{var}{defou} }, #. \$o->{var}{suffix} },
- ],
- post => \&do_it_user_add,
- next => $o->{var}{useraddisnogood},
- },
- summary_set_srv => {
- name => N("Confirmation Information for create an LDAP server"),
- data => [
- { label => " " },
- { label => N("LDAP directory tree:"), type => 'field', val_ref => \$o->{var}{suffix} },
- { label => N("LDAP Administrator:"), type => 'field', val_ref => \$o->{var}{rootdn} },
- { label => N("Users Container:"), type => 'field', val_ref => \$o->{var}{defou} },
- ],
- post => \&do_it_setldap,
- next => 'end',
- },
- end => {
- name => N("Congratulations"),
- data => [
- {
- label => " " },
- {
- label => N("The wizard successfully configured the LDAP.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
- add_user_good => {
- name => N("Successfully added User"),
- data => [
- { label => " " },
- { label => "\n" , val_ref => \$o->{var}{error_user_add} },
- ],
- no_back => '1',
- next => 'ask_menu',
- },
- add_user_nogood => {
- name => N("Error when adding user in Ldap database"),
- data => [
- { label => " " },
- { label => "\n" , val_ref => \$o->{var}{error_user_add} },
- ],
- no_back => '1',
- next => 'add_userposix',
- },
- resume => {
- name => N("Server already configured") . "\n\n" . N("You have already configured your Ldap Server") ,
- post => sub {
- my $container_ou = $o->{var}{wiz_level} . "," . $o->{var}{suffix};
- },
- data => [ { label => " " } ,
- { label => N("LDAP directory tree:"), type => 'field', val_ref => \$o->{var}{suffix} },
- { label => N("LDAP Administrator:"), type => 'field', val_ref => \$o->{var}{rootdn} },
- { label => N("Users Container:"), type => 'field', val_ref => \$o->{var}{defou} },
- ],
- no_back => '1',
- next => 'ask_menu',
- },
- };
-
-
-sub do_it_setldap {
- return if $::testing;
- if (!-f $LDAPCONF) {
- die "no $LDAPCONF found";
- }
- cp_af($LDAPCONF, $LDAPCONF . '.save');
- if (!-f "$LDAPCONF.example") {
- cp_af($LDAPCONF, $LDAPCONF . '.example');
- }
- cp_af($LDAPCONF . '.example', $LDAPCONF);
- # set suffix
- if (any { /^suffix/ } cat_($LDAPCONF)) {
- substInFile {
- s/suffix.*/suffix\t"$o->{var}{suffix}"/;
- } $LDAPCONF;
- } else {
- append_to_file($LDAPCONF, qq(suffix\t"$o->{var}{suffix}"));
- }
-
- # s/example/$dcall
- substInFile {
- s/dc=example,dc=com/$o->{var}{suffix}/g;
- } $LDAPCONF;
-
- # set rootdn
- if (any { /^rootdn/ } cat_($LDAPCONF)) {
- substInFile {
- s/rootdn.*/rootdn\t"$o->{var}{rootdn}"/;
- } $LDAPCONF;
- } else {
- append_to_file($LDAPCONF, qq(rootdn\t"$o->{var}{rootdn},$o->{var}{suffix}"));
- }
-
- # set rootpass
- my $_cryptpass = crypt($o->{var}{rootpass}, "crypt");
- if (any { /^rootpw/ } cat_($LDAPCONF)) {
- substInFile {
- #s/rootpw.*/rootpw $cryptpass/;
- s/rootpw.*/rootpw $o->{var}{rootpass}/;
- } $LDAPCONF;
- } else {
- #append_to_file($LDAPCONF, "rootpw {CRYPT}$cryptpass");
- append_to_file($LDAPCONF, "rootpw $o->{var}{rootpass}");
- }
-
- # Modify /etc/ldap.conf
- #
- require authentication;
- authentication::update_ldap_conf(
- host => $o->{var}{srv},
- base => $wiz_domain_name,
- nss_base_shadow => "ou=People,$o->{var}{suffix}",
- nss_base_passwd => "ou=People,$o->{var}{suffix}",
- nss_base_group => "ou=Groups,$o->{var}{suffix}",
- );
-
- # reset premisions
- system("chown -R root.ldap /etc/openldap");
- services::restart('ldap');
- sleep(4);
- init_ldap();
-
-
-
-}
-
-
-sub init_ldap {
- my $_root_cn = (split('=', (split(/,/, $o->{var}{rootdn}))[0]))[1];
- my $ldap_dc = (split('=', (split(/,/, $o->{var}{suffix}))[0]))[1];
-
- $o->{var}{rootdn} =~ /cn=(\w+),/ and my $cnadmin = $1;
-
- my $LDAP;
- open($LDAP, "| ldapadd -x -D '$o->{var}{rootdn}' -w $o->{var}{rootpass}");
-
- print $LDAP <<RootLdif;
-dn: $o->{var}{suffix}
-dc: $ldap_dc
-objectClass: dcObject
-objectClass: organization
-o: Company
-
-dn: $o->{var}{rootdn}
-objectClass: organizationalRole
-cn: $cnadmin
-
-dn: ou=Hosts,$o->{var}{suffix}
-ou: Hosts
-description: OU Hosts
-objectClass: top
-objectClass: organizationalUnit
-
-dn: ou=People,$o->{var}{suffix}
-ou: People
-description: OU People
-objectClass: top
-objectClass: organizationalUnit
-
-dn: ou=Groups,$o->{var}{suffix}
-ou: Groups
-description: OU Groups
-objectClass: top
-objectClass: organizationalUnit
-
-
-RootLdif
-
- close($LDAP);
-
- # create config file in /etc/sysconfig/ldapwiz
- output($conf_file, <<EOF);
-srv=$o->{var}{srv}
-suffix=$o->{var}{suffix}
-rootdn=$o->{var}{rootdn}
-rootpass=$o->{var}{rootpass}
-users=$o->{var}{defou}
-EOF
-
-system("chmod 700 /etc/sysconfig/ldapwiz");
-
-}
-
-sub do_it_user_add {
- return if $::testing;
- my $uid = "10000";
- while (defined(getpwuid($uid))) {
- $uid++;
- }
-
- $o->{var}{uidnb} = $uid;
- $o->{var}{gidnb} = $uid;
- ($o->{var}{code_return}, $o->{var}{error_user_add}) = add_user($o);
-
- if ($o->{var}{code_return} =~ /success/i) {
- $o->{var}{useraddisnogood} = "add_user_good";
- } else {
- $o->{var}{useraddisnogood} = "add_user_nogood";
- }
-}
-
-sub sav_conf {
- services::stop('ldap');
- my $cmd = "slapcat -l /root/ldap-sav.ldiff";
- system($cmd) == 0 or !$::testing and err_dialog(N("Error!"), N("%s Failed", $cmd));
- system("cp /etc/openldap/slapd.conf /root/slapd.save");
- system("rm /etc/sysconfig/ldapwiz");
- system("rm -fr /var/lib/ldap/*");
-}
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-1;
diff --git a/ldap_wizard/images/ldap.png b/ldap_wizard/images/ldap.png
deleted file mode 100644
index 613c8358..00000000
--- a/ldap_wizard/images/ldap.png
+++ /dev/null
Binary files differ
diff --git a/ldap_wizard/ldapdef.pm b/ldap_wizard/ldapdef.pm
deleted file mode 100644
index d731d24f..00000000
--- a/ldap_wizard/ldapdef.pm
+++ /dev/null
@@ -1,108 +0,0 @@
-package MDK::Wizard::ldapdef;
-
-use strict;
-use Net::LDAP;
-use Net::LDAP::Util qw(ldap_error_text);
-use MDK::Common;
-use standalone;
-use common;
-use ugtk2 qw(:dialogs :create);
-
-require Exporter;
-
-use vars qw(@ISA @EXPORT %cfg %cfgfile $congfile $msg $attrs %ldap $ldap);
-@ISA=qw(Exporter);
-@EXPORT=qw( %cfg %cfgfile $congfile ldap_connect root_bind $msg anonymous_bind ldap_search get_dn $attrs get_dse %ldap add_user);
-
-
-# Connect to Ldap server
-sub ldap_connect {
- my ($u) = @_;
- my $ldap = Net::LDAP->new($u->{var}{srv}) or err_dialog("Error!", "Unable to connect to %s", $u->{var}{srv});
- return $ldap;
-}
-
-# bind root
-sub root_bind {
- my ($ldap, $u) = @_;
- my $mesg = $ldap->bind(dn => $u->{var}{rootdn},password => $u->{var}{rootpass});
- return $mesg;
-}
-
-
-sub anonymous_bind {
- my ($ldap) = @_;
- my $mesg = $ldap->bind;
- return $mesg;
-}
-
-sub ldap_search {
- my ($ldap, $filter, $basedn) = @_;
- my $attrs = ['objectClass'];
- my $mesg = $ldap->search(
- base => $basedn,
- filter => $filter,
- scope => "sub",
- attrs => $attrs
- );
- my $href = $mesg->as_struct;
- print("Search results\n");
- print $href;
-}
-
-sub get_dn {
- my ($ldap, $filter, $basedn) = @_;
- my $mesg = $ldap->search(
- base => $basedn,
- filter => $filter,
- scope => "sub",
- #attrs => $attrs
- );
- #my $entry = "";
- #foreach $entry ($mesg->entries) {
- #print "show DN ".$entry->dn."\n";
- #}
- return $mesg
-}
-
-sub get_dse() {
- my $ldap = ldap_connect();
- my $result = get_dn($ldap, "(objectclass=organization)", $cfg{base});
- my @arrayOfDNs = $result->entries;
- #my %ldap = ();
- foreach my $dn_value (@arrayOfDNs)
- {
- my $orga = $dn_value->dn;
- $ldap{orga} = $orga;
- }
- return %ldap;
-}
-
-sub add_user {
- my ($u) = @_;
- my $ldap = ldap_connect($u);
- root_bind($ldap,$u);
- my $result = $ldap->add(
- "uid=$u->{var}{uid},$u->{var}{defou},$u->{var}{suffix}",
- attr => [
- objectclass => ["top", "posixAccount", "inetOrgPerson", "shadowAccount"],
- sn => $u->{var}{sn},
- uid => $u->{var}{uid},
- cn => $u->{var}{cn},
- userPassword => $u->{var}{uidpass},
- loginShell => $u->{var}{lshell},
- uidNumber => $u->{var}{uidnb},
- gidNumber => $u->{var}{gidnb},
- homeDirectory => $u->{var}{home} . $u->{var}{uid},
- shadowMin => '-1',
- shadowMax => '999999',
- shadowWarning => '7',
- shadowInactive => '-1',
- shadowExpire => '-1',
- ]
- );
-# create_dialog("", ldap_error_text($result->code));
- #$result->code && die $result->error;
- return $result->error, ldap_error_text($result->code);
- #return ldap_error_text($result->code);
-}
diff --git a/news_wizard/.perl_checker b/news_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/news_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/news_wizard/Inn.pm b/news_wizard/Inn.pm
deleted file mode 100755
index 0cd3e06f..00000000
--- a/news_wizard/Inn.pm
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-
-# Copyright (C) 2003 Mandrakesoft
-#
-# Author: Florent Villard <warly@mandrakesoft.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Inn;
-use strict;
-
-use common;
-require MDK::Wizard::Wizcommon;
-use MDK::Wizard::Varspaceval;
-
-my $wiz = new MDK::Wizard::Wizcommon;
-
-my $o = {
- name => N("News Wizard"),
- var => {
- news_server => '',
- news_freq => ''
- },
- needed_rpm => [ 'inn' ],
- defaultimage => "$ENV{__WIZ_HOME__}news_wizard/images/news.png"
- };
-
-$o->{pages} = {
- welcome => {
- name => N("Welcome to the News Wizard") . "\n\n" . N("This wizard will help you configuring the Internet News services for your network."),
- no_back => 1,
- next => 'ask_news_server'
- },
- ask_news_server => {
- name => N("News server") . "\n\n" . N("The news server name is the name of the host providing the Internet news to your network; the name is usually provided by your provider.") . "\n\n" . N("Internet host names must be in the form \"host.domain.domaintype\"; for example, if your provider is \"provider.com\", the Internet news server is usually \"news.provider.com\"."),
- pre => sub {
- $o->{var}{news_server} ||= get_server();
- },
- data => [
- { label => N("News server name:"), val => \$o->{var}{news_server} },
- ],
- post => sub { $o->{var}{news_server} || 'error_in_news_server' },
- next => 'ask_news_freq'
- },
- ask_news_freq => {
- name => N("Polling period") . "\n\n" . N("Your server will regularly poll the News server to obtain the latest Internet News; the polling period sets the interval between two consecutive attempts.") . "\n\n" . N("Depending on the kind of Internet connection you have, an appropriate polling period can change between 6 and 24 hours."),
- pre => sub {
- $o->{var}{news_freq} ||= 24;
- },
- data => [
- { label => N("Polling period (hours):"), val => \$o->{var}{news_freq} },
- ],
- post => \&check_valid_hours,
- next => 'summary'
- },
- warning => {
- name => N("Warning."),
- ignore => 1,
- next => 'summary'
- },
- error_in_news_server => {
- name => N("Error.") . "\n\n" . N("The news server name is not correct"),
- ignore => 1,
- next => 'ask_news_server'
- },
- error_in_polling_time => {
- name => N("Error.") . "\n\n" . N("The polling period is not correct"),
- ignore => 1,
- next => 'ask_news_freq'
- },
- summary => {
- name => N("Configuring the Internet News") . "\n\n" . N("The wizard collected the following parameters needed to configure your Internet News service:") . "\n\n" . N("To accept these values, and configure your server, click the next button or use the back button to correct them."),
- data => [
- { label => N("News server:"), val_ref => \$o->{var}{news_server} },
- { label => N("Polling interval:"), val_ref => \$o->{var}{news_freq} },
- ],
- post => \&do_it,
- next => 'end'
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Internet News service of your server."),
- end => 1,
- next => 0
- },
-};
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-sub check_valid_hours {
- $o->{var}{news_freq} =~ /^\d+$/ or return 'error_in_polling_time'
-}
-
-sub normalize_freq {
- my ($freq) = @_;
-
- if ($freq =~ /(\d*)/) {
- $freq = $1;
- }
- if ($freq <= 0) {
- $freq = 0;
- }
- if ($freq >= 24) {
- $freq = 24;
- }
- $freq;
-}
-
-sub get_server {
- my %mdk = MDK::Wizard::Varspaceval->get("/etc/leafnode/config");
- $mdk{server}
-}
-
-sub normalize_server {
- my ($server) = @_;
- $server
-}
-
-sub do_it {
- $::testing and return;
- $o->{var}{news_freq} and my $freq = normalize_freq($o->{var}{news_freq}) or
- die "freq not defined: $!";
- $o->{var}{news_server} and my $server = normalize_server($o->{var}{news_server}) or
- die "server not defined: $!";
- my $file = "/etc/leafnode/config";
- -d "/etc/leafnode" or mkdir "/etc/leafnode";
- output($file, map {
- s|__server__|$server|g;
- $_;
- } cat_("__WIZ_HOME__/news_wizard/scripts/config.default"));
- $file = "/var/spool/cron/news";
- my $file_c = "/etc/leafnode/crontab";
- if (-f $file) {
- MDK::Common::cp_af($file, $file_c);
- MDK::Common::cp_af($file, $file . ".orig");
- }
- output($file_c, map {
- s|__freq__|$freq|g;
- $_;
- } cat_("__WIZ_HOME__/news_wizard/scripts/news.cron"));
- system("crontab -u news /etc/leafnode/crontab");
-}
-
-1;
diff --git a/news_wizard/Makefile b/news_wizard/Makefile
deleted file mode 100644
index 27ec47ef..00000000
--- a/news_wizard/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/news_wizard
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/news_wizard/scripts
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/news_wizard/images
- install --mode=u=rw,g=r,o=r -p news.wiz ${prefix}/share/wizards/news_wizard
-
-
-
-
-
- install --mode=a=r -p ./images/news.png ${prefix}/share/wizards/news_wizard/images
- install --mode=u=rwx,g=rx,o=rx -p scripts/*.sh ${prefix}/share/wizards/news_wizard/scripts
- install --mode=u=rw,g=r,o=r -p scripts/Newsconf.pm ${prefix}/share/wizards/news_wizard/scripts
- find scripts -name "*.default" -exec cp '{}' ${prefix}/share/wizards/news_wizard/scripts \;
- find scripts -name "*.patch" -exec cp '{}' ${prefix}/share/wizards/news_wizard/scripts \;
- find scripts -name "*.cron" -exec cp '{}' ${prefix}/share/wizards/news_wizard/scripts \;
-
-
-run:
- (su -c "make install; unset WIZPATH; export DEBUG_WIZ='/dev/pts/0'; wiz /usr/share/wizards/news_wizard/news.wiz")
-
-desktop:
- cp -f desktop_data/news_wizard\ wiz ${HOME}/Desktop
- cp -f desktop_data/util1.gif ${HOME}/.kde/share/icons/
-
diff --git a/news_wizard/scripts/check_news_server.sh b/news_wizard/scripts/check_news_server.sh
deleted file mode 100755
index f1eee021..00000000
--- a/news_wizard/scripts/check_news_server.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard leafnode configuration
-#
-# checking if the provided server is correct :
-# strip the @ and illegal characters
-
-
-if [ -z "${wiz_news_server}" ] ;then
- echo_debug "wiz_news_server is empty, should not."
- exit 1
-fi
-
-
-test=`echo ${wiz_news_server##*@} |sed -e 's/[^0-9a-zA-Z-\.]//g'`
-
-if [ -z "${test}" ] ;then
- echo_debug "wiz_news_server is empty, should not."
- exit 1
-fi
-
-
-# all seems to be ok
-exit 10
-
diff --git a/news_wizard/scripts/check_valid_hours.sh b/news_wizard/scripts/check_valid_hours.sh
deleted file mode 100755
index ea30c0bd..00000000
--- a/news_wizard/scripts/check_valid_hours.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard leafnode configuration
-#
-# checking if the provided hours are correct :
-# from 1 to 24
-
-
-if [ -z "${wiz_news_freq}" ] ;then
- echo_debug "wiz_news_freq is empty, should not."
- exit 1
-fi
-
-typeset -i test
-
-test=`echo ${wiz_news_freq} |sed -e 's/[^0-9]//g'`
-
-if [ -z "${test}" ] ;then
- echo_debug "wiz_news_freq is empty, should not."
- exit 1
-fi
-
-
-# all seems to be ok
-exit 10
-
diff --git a/news_wizard/scripts/config.default b/news_wizard/scripts/config.default
deleted file mode 100644
index c1c98a3d..00000000
--- a/news_wizard/scripts/config.default
+++ /dev/null
@@ -1,116 +0,0 @@
-## This is the NNTP server leafnode fetches its news from.
-## You need read and post access to it. Mandatory.
-server = __server__
-
-## Unread discussion threads will be deleted after this many days if
-## you don't define special expire times. Mandatory.
-expire = 14
-
-##
-## All the following parameters are optional
-##
-
-## I have free access to my news server. If you don't have, comment out
-## the following two lines and change them accordingly.
-# username = gulbrandsen
-# password = secret
-
-## Standard news servers run on port 119. If your newsserver doesn't, comment
-## out the following line and change it accordingly.
-# port = 8000
-
-## This is another news server which stores some groups that are not
-## available on the first one. You can define username, password and port
-## for each server separately.
-# server = sex.and.warez.com
-# username = xenu
-# password = secret
-
-## This is a news server which does not understand the
-## "LIST NEWSGROUP news.group" command. For this reason, we don't try to
-## download newsgroups descriptions when getting new newsgroups. This is
-## achieved by putting "nodesc = 1" somewhere behind the server
-## line.
-# server = broken.upstream.server
-# nodesc = 1
-
-## Here we have another news server which has a very slow connection. For
-## that reason, we wait a full minute before we give up trying to connect.
-## The default is 10 seconds.
-# server = really.slow.snail
-# timeout = 60
-
-## Non-standard expire times (glob(7) wildcard constructs possible)
-# groupexpire comp.os.linux.* = 5 # groups too big to hold articles 20 days
-# groupexpire any.local.newsgroup = 100 # very interesting, hold articles longer
-
-## Never fetch more than this many articles from one group in one run.
-## Be careful with this; setting it much below 1000 is probably a bad
-## idea.
-maxfetch = 2000
-
-## Fetch only a few articles when we subscribe a new newsgroup. The
-## default is to fetch all articles.
-initialfetch = 1000
-
-## If you want to use leafnode like an offline newsreader (e.g. Forte
-## Agent) you can download headers and bodies separately if you set
-## delaybody to 1. In this case, fetch will only download the headers
-## and only when you select an article, it will download the body.
-## This can save a huge amount of bandwith if only few articles are really
-## read from groups with lots of postings.
-## This feature works not very well with Netscape, though (which is not
-## a fault of Leafnode).
-# delaybody = 0
-
-## To avoid spam, you can select the maximum number of crosspostings
-## that are allowed in incoming postings. Setting this below 5 is
-## probably a bad idea. The default is unlimited crossposting.
-maxcrosspost = 8
-
-## If you suffer from repeatedly receiving old postings (this happens
-## sometimes when an upstream server goes into hiccup mode) you can
-## refuse to receive them with the parameter "maxage" which tells the
-## maximum allowed age of an article in days. The default maxage is 10
-## days.
-maxage = 7
-
-## maxlines will make fetch reject postings that are longer than a certain
-## amount of lines.
-maxlines = 500
-
-## minlines will make fetch reject postings that are shorter than a certain
-## amount of lines.
-minlines = 2
-
-## maxbytes will make fetch reject postings that are larger
-maxbytes = 50000
-
-## timeout_short determines how many days fetch gets a newsgroup which
-## has been accidentally opened. The default is two days.
-timeout_short = 2
-
-## timeout_long determines how many days fetch will wait before not getting
-## an unread newsgroup any more. The default is seven days.
-timeout_long = 7
-
-## timeout_active determines how many days fetch will wait before re-reading
-## the whole active file. The default is 90 days.
-# timeout_active = 365
-
-## If you want to have your newsreader score/kill on Xref: lines, you might
-## want to uncomment this.
-# create_all_links = 1
-
-## If you want to filter out certain regular expressions in the header,
-## create a "filterfile" (how this is done is explained in the README)
-## and set
-# filterfile = /path/to/your/filterfile
-
-## If your newsreader does not supply a Message-ID for your postings
-## Leafnode will supply one, using the hostname of the machine it is
-## running on. If this hostname is not suitable, this parameter can be
-## used to override it. Do not use a fantasy name, it may interfere with
-## the propagation of your messages. Most modern newsreaders do provide
-## a Message-ID.
-# hostname = host.domain.country
diff --git a/news_wizard/scripts/do_it_news.sh b/news_wizard/scripts/do_it_news.sh
deleted file mode 100755
index a67d0d99..00000000
--- a/news_wizard/scripts/do_it_news.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard leafnode configuration
-#
-# put the default leafnode configuration
-# assuming all dependencies are ok
-
-
-# wiz_news_server and wiz_news_freq are provided by the running wizard
-
-# security
-typeset -i freq
-freq=`echo ${wiz_news_freq} |sed -e 's/[^0-9]//g'`
-
-if [ $freq -le 0 ]; then
- freq=1
-fi
-if [ $freq -ge 24 ]; then
- freq=24
-fi
-
-
-server=`echo ${wiz_news_server##*@} |sed -e 's/[^0-9a-zA-Z-\.]//g'`
-
-# store the wiz_news_server and wiz_news_freq value
-file=/etc/sysconfig/mdk_serv
-chg_val ${file} wiz_news_freq ${freq} s
-chg_val ${file} wiz_news_server ${server} s
-
-
-# leafnode configuration file
-config="/etc/leafnode/config"
-if [ ! -f ${config} ]; then
- echo_debug "no leafnode configuration file found ! exiting."
- exit 1
-fi
-
-bck_file ${config}
-
-cat ${CWD}/scripts/config.default \
-| sed -e 's/__server__/'"${server}"'/' > ${config}
-
-echo_debug "config file done, putting crontab for news"
-
-if [ -f /var/spool/cron/news ]; then
- cp -f /var/spool/cron/news /etc/leafnode/crontab
-fi
-
-bck_file /etc/leafnode/crontab
-
-cat ${CWD}/scripts/news.cron \
-| sed -e 's/__freq__/'"${freq}"'/' > /etc/leafnode/crontab
-
-
-echo_debug "installing news crontab"
-crontab -u news /etc/leafnode/crontab
-
-
-# all is ok
-exit 10
-
-
-
diff --git a/news_wizard/scripts/news.cron b/news_wizard/scripts/news.cron
deleted file mode 100644
index 5785bfb2..00000000
--- a/news_wizard/scripts/news.cron
+++ /dev/null
@@ -1,10 +0,0 @@
-### leafnode crontab
-SHELL=/bin/bash
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-MAILTO=root@localhost
-
-
-35 4 * * * /usr/sbin/texpire
-
-5 */__freq__ * * * /usr/sbin/fetchnews -v 2>&1
-
diff --git a/nfs_wizard/.perl_checker b/nfs_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/nfs_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/nfs_wizard/Makefile b/nfs_wizard/Makefile
deleted file mode 100644
index 7b0d0866..00000000
--- a/nfs_wizard/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nfs_wizard
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nfs_wizard/scripts
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nfs_wizard/images
- install --mode=u=rwx,g=rx,o=rx -p nfs.wiz ${prefix}/share/wizards/nfs_wizard
- install --mode=a=r -p images/IC-NFS-48.png ${prefix}/share/wizards/nfs_wizard/images
- install --mode=u=rwx,g=rx,o=rx -p scripts/*.sh ${prefix}/share/wizards/nfs_wizard/scripts
- install --mode=u=rw,g=r,o=r -p scripts/NFSConf.pm ${prefix}/share/wizards/nfs_wizard/scripts
diff --git a/nfs_wizard/NFS.pm b/nfs_wizard/NFS.pm
deleted file mode 100755
index eedf6259..00000000
--- a/nfs_wizard/NFS.pm
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-
-# Copyright (C) 2002,2003 Mandrakesoft
-#
-# Authors: Arnaud Desmons <adesmons@mandrakesoft.com>
-# Florent Villard <warly@mandrakesoft.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::NFS;
-use strict;
-
-use common;
-use services;
-use MDK::Wizard::Wizcommon;
-
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-
-my $o = {
- name => N("NFS Wizard"),
- var => {
- wiz_nfs_dir => '',
- wiz_nfs_level => '',
- wiz_netmask => ''
- },
- needed_rpm => [ 'nfs-utils' ],
- defaultimage => "/usr/share/mcc/themes/default/nfs_server-mdk.png",
- };
-
-my %level = (
- 1 => N("All - No access restriction"),
- 2 => N("Local Network - access for local network (recommended)")
-);
-
-$o->{pages} = {
- welcome => {
- name => N("NFS Server Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the NFS server for your network."),
- no_back => 1,
- pre => sub {
- $in->ask_warn((""), N("You should now use draknfs to configure your NFS share.")) or $in->exit;
- },
- next => 'nfs'
- },
- nfs => {
- name => N("NFS server") . "\n\n" .N("Directory which will be exported to NFS clients. This directory will be exported in read only mode. It denies any request which requires changes to the filesystem."),
- data => [
- { label => N("Directory:"), val => \$o->{var}{wiz_nfs_dir} },
- { label => N("Create directory if it doesn't exist"), type => 'bool', val => \$o->{var}{create_missing_directory} },
- ],
- complete => sub {
- if (!-d $o->{var}{wiz_nfs_dir} and $o->{var}{create_missing_directory}) {
- mkdir_p($o->{var}{wiz_nfs_dir});
- } elsif (!-d $o->{var}{wiz_nfs_dir}) {
- $in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually."));
- return 1; }
- },
- next => 'ask_level'
- },
- ask_level => {
- name => N("Access control") . "\n\n" . N("NFS can be restricted to a certain ip class") . "\n\n" . N("Choose the level that suits your needs. If you don't know, the local network level is usually the most appropriate. Beware that the all level may be not secure."),
- pre => sub {
- $o->{var}{wiz_netmask} = network_mask() if !$o->{var}{wiz_netmask} || $o->{var}{wiz_netmask} eq '0.0.0.0/0.0.0.0'
- },
- data => [
- { val => \$o->{var}{wiz_nfs_level}, list => [ keys %level ], format => sub { $level{$_[0]} } },
- ],
- post => \&chooser,
- next => 'summary'
- },
- shownet => {
- name => N("Grant access on local network") . "\n\n" . N("Access will be allowed for hosts on the network. Here is the information found about your current local network, you can modify it if needed."),
- data => [
- { label => N("Authorized network:"), val => \$o->{var}{wiz_netmask} },
- ],
- next => 'summary'
-
- },
- summary => {
- name => N("The wizard collected the following parameters."),
- pre => sub {
- $o->{var}{wiz_text_level} = $level{$o->{var}{wiz_nfs_level}};
- $o->{var}{wiz_netmask} = $o->{var}{wiz_nfs_level} == 1 ? "0.0.0.0/0.0.0.0" : $o->{var}{wiz_netmask}
- },
- data => [
- { label => N("Exported dir:"), val_ref => \$o->{var}{wiz_nfs_dir} },
- { label => N("Access:"), val_ref => \$o->{var}{wiz_text_level} },
- { label => N("Netmask:"), val_ref => \$o->{var}{wiz_netmask} },
- ],
- post => \&do_it,
- next => 'end'
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your NFS server."),
- end => 1,
- next => 0
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
-
- };
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-sub network_mask {
- my $wiz_ip_server = $wiz->{net}->itf_get("IPADDR");
- my $mask = $wiz->{net}->itf_get("NETMASK");
- $mask = $mask || "255.255.255.0";
- $wiz_ip_server = $wiz_ip_server || "192.168.1.0";
- "$1.$2.$3.0/$mask" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
-}
-
-sub chooser {
- $o->{var}{wiz_nfs_level} == 2 || 'shownet'
-}
-
-sub do_it {
- $::testing and return;
- my $line;
- my $file = "/etc/exports";
- chomp($o->{var}{wiz_nfs_dir});
- -f $file and cp_af($file, $file.".orig");
- if ($o->{var}{wiz_nfs_level} == 2) {
- #my $mask = $wiz->{net}->itf_get("NETMASK");
- $line = "$o->{var}{wiz_nfs_dir} $o->{var}{wiz_netmask}(ro,no_root_squash,sync)\n";
- }
- else {
- $line = "$o->{var}{wiz_nfs_dir} *(rw,no_root_squash,sync)\n";
- }
- my $t;
- foreach (cat_($file)) {
- if (/^(?!#).*$o->{var}{wiz_nfs_dir}\s/) {
- $t = $_;
- last;
- }
- }
- substInFile { s|^(?!#).*$o->{var}{wiz_nfs_dir}\s.*|#$&| } $file;
- append_to_file($file, $line);
- system("/usr/sbin/exportfs -a");
- services::start('nfs') if services::is_service_running('nfs');
- check_started('nfsd');
-}
-
-1;
diff --git a/nfs_wizard/images/IC-NFS-48.png b/nfs_wizard/images/IC-NFS-48.png
deleted file mode 100644
index 56f53d5e..00000000
--- a/nfs_wizard/images/IC-NFS-48.png
+++ /dev/null
Binary files differ
diff --git a/nfs_wizard/nfs.wiz b/nfs_wizard/nfs.wiz
deleted file mode 100644
index 6781d47c..00000000
--- a/nfs_wizard/nfs.wiz
+++ /dev/null
@@ -1,291 +0,0 @@
-<?xml version="1.0"?>
-
-
-<Wizard
- name="general"
- libScript="__WIZ_HOME__/common/scripts/functions.sh"
- wizardTitle="NFS Wizard"
- imagePosition="top"
- defaultImage="__WIZ_HOME__/nfs_wizard/images/NFS.png"
- perlModule="__WIZ_HOME__/nfs_wizard/scripts/NFSConf.pm"
- rpm="nfs-utils"
- summaryFunc="do_it"
->
-
- <Variable
- name="varwiz_nfs_dir"
- shellVariable="wiz_nfs_dir"
- defaultValue="/home/public"
- persistent="false"
- >
- </Variable>
- <Variable
- name="wiz_nfs_level"
- comment="The proxy access control level"
- shellVariable="wiz_nfs_level"
- defaultValue="2"
- >
- </Variable>
- <Variable
- name="wiz_netmask"
- shellVariable="wiz_netmask"
- >
- </Variable>
- <Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
- name="welcome"
- jumpPage="nfs connections"
- executionLevel="NORMAL"
- nextFinish="false"
- canBack="true"
- canCancel="true"
- >
- <Info
- name="info1"
- alignement="Center"
- helpText="NFS Server Configuration Wizard"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
- >
- </Info>
-
- <Info
- name="info2"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Info
- name="info3"
- alignement="Center"
- helpText="This wizard will help you configuring the NFS Server for your network."
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
- </Page>
-
- <Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
- name="nfs connections"
- jumpPage="ask_level"
- executionLevel="NORMAL"
- nextFinish="false"
- canBack="true"
- canCancel="true"
- >
-
- <Info
- name="nfs Title"
- alignement="Center"
- helpText="NFS Server"
- guiType="label"
- fontName="Default"
- fontStyle="bold"
- fontSize="14"
- >
- </Info>
-
- <Info
- name="info27"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <TDline
- name="line1"
- >
- </TDline>
-
- <Info
- name="info30"
- alignement="Center"
- guiType="label"
- fontName="Default"
- fontStyle="plain"
- fontSize="11"
- >
- </Info>
-
- <Freetext
- variableName="varwiz_nfs_dir"
- helpText="Directory:"
- guiType="textfield"
- editable="true"
- >
- </Freetext>
- </Page>
-
- <Page
- name="ask_level"
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-proxy.html"
- func="chooser"
- executionLevel="NORMAL"
- nextFinish="false"
- canBack="true"
- canCancel="true"
- >
-
- <Target
- targetName="doit"
- jumpIndex="1"
- >
- </Target>
-
- <Target
- targetName="shownet"
- jumpIndex="2"
- >
- </Target>
- <Info
- helpText="Access Control"
- >
- </Info>
-
-
- <Info
- helpText="NFS can be restricted to a certain ip class"
- >
- </Info>
-
- <Info
- helpText="Choose the level that suits your needs. If you don't know, the Local Network level is usually the most appropriate. Beware that the All level may be not secure."
- >
- </Info>
-
-
- <Chooser
- name="chooser1"
- variableName="wiz_nfs_level"
- >
-
- <Option
- value="1"
- description="All - No access restriction"
- >
- </Option>
-
- <Option
- value="2"
- description="Local Network - access for local network (recommended)"
- >
- </Option>
- </Chooser>
- </Page>
- <Page
- name="shownet"
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-proxy.html"
- jumpPage="doit"
- executionLevel="NORMAL"
- nextFinish="false"
- is="wiz_nfs_level=2"
- canBack="true"
- canCancel="true"
- >
-
- <Info
- helpText="Grant access on local network"
- >
- </Info>
-
-
- <Info
- helpText="Access will be allowed for hosts on the network. Here is the information found about your current local network, you can modify it if needed."
- >
- </Info>
- <Freetext
- name="f_wiz_squid_mynetw"
- fillfunc="network_mask"
- variableName="wiz_netmask"
- helpText="Authorized network:"
- editable="true"
- >
- </Freetext>
-
- </Page>
-
- <Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-samba.html"
- name="doit"
- func="do_it"
- nextButtonText="Configure"
- executionLevel="NORMAL"
- nextFinish="false"
- canBack="true"
- canCancel="true"
- >
- <Target
- targetName="catastrophic_exit"
- jumpIndex="2"
- >
- </Target>
-
- <Target
- targetName="congratulations"
- jumpIndex="10"
- >
- </Target>
-
- <Info
- helpText="The wizard collected the following parameters."
- >
- </Info>
-
- <Freetext
- name="freetext"
- variableName="varwiz_nfs_dir"
- helpText="Exported dir:"
- editable="false"
- >
- </Freetext>
-
- <Freetext
- name="freetext"
- variableName="wiz_nfs_level"
- helpText="Access :"
- editable="false"
- >
- </Freetext>
-
- <Freetext
- name="freetext1"
- variableName="wiz_netmask"
- helpText="Netmask :"
- editable="false"
- >
- </Freetext>
-
- </Page>
-
- <Page
- helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-nfs.html"
- name="congratulations"
- nextButtonText="Quit"
- executionLevel="NORMAL"
- nextFinish="true"
- canBack="false"
- canCancel="false"
- >
-
- <Info
- helpText="Congratulations"
- >
- </Info>
- <Info
- helpText="The wizard successfully configured your NFS Server"
- >
- </Info>
- </Page>
-</Wizard>
diff --git a/nfs_wizard/scripts/NFSConf.pm b/nfs_wizard/scripts/NFSConf.pm
deleted file mode 100644
index 580aa9ef..00000000
--- a/nfs_wizard/scripts/NFSConf.pm
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-
-# Copyright (C) 2002 MandrakeSoft Arnaud Desmons (adesmons@mandrakesoft.com)
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package NFSConf;
-use lib "/usr/lib/libDrakX";
-require "__WIZ_HOME__/common/scripts/Vareqval.pm";
-require "__WIZ_HOME__/common/scripts/IFCFG.pm";
-use MDK::Common;
-use services;
-use strict;
-
-my $o = IFCFG->new();
-
-sub network_mask {
- my $wiz_ip_server = $o->itf_get("IPADDR");
- my $mask = $o->itf_get("NETMASK");
- $mask = $mask ? $mask : "255.255.255.0";
- $wiz_ip_server = $wiz_ip_server ? $wiz_ip_server : "192.168.1.0";
- "$1.$2.$3.0/$mask" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
-}
-
-sub chooser {
- $ENV{wiz_nfs_level};
-}
-
-sub do_it {
- my $line;
- my $file = "/etc/exports";
- chomp($ENV{wiz_nfs_dir});
- -f $file and cp_af($file, $file.".orig");
- if ($ENV{wiz_nfs_level} == 2) {
- my $mask = $o->itf_get("NETMASK");
- $line = "$ENV{wiz_nfs_dir} $ENV{wiz_netmask}(rw,no_root_squash)\n";
- }
- else {
- $line = "$ENV{wiz_nfs_dir} *(rw,no_root_squash)\n";
- }
- my $t;
- foreach (cat_($file)) {
- if (/^(?!\#).*$ENV{wiz_nfs_dir}\s.*/) {
- $t = $_;
- last;
- }
- }
- substInFile { s|^(?!\#).*$ENV{wiz_nfs_dir}\s.*|\#$&|} $file;
- append_to_file($file, $line);
- system("/usr/sbin/exportfs -a");
- services::is_service_running('nfs') and services::start('nfs');
- 10
-}
diff --git a/nfs_wizard/scripts/do_it_nfs.sh b/nfs_wizard/scripts/do_it_nfs.sh
deleted file mode 100755
index 917d838d..00000000
--- a/nfs_wizard/scripts/do_it_nfs.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Philippe Vivien, Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard nfs configuration
-#
-# modify default nfs configuration
-# assuming all dependencies are ok
-#
-# WARNING : just using /etc/exports for nfs configuration, assuming
-# other files are close to standard configuration
-
-nfs_file="/etc/exports"
-
-echo "${wiz_nfs_dir} ${wiz_ip_net} ${wiz_ip_netmask}"
-echo "wiz_ip_net:${wiz_ip_net}" >t.log
-echo "wiz_ip_netmask:${wiz_ip_netmask}" >>t.log
-
-echo "dir:${wiz_nfs_dir}" >>t.log
-echo "clt:${wiz_ip_net}/${wiz_ip_netmask}" >>t.log
-
-echo "export :\n">>t.log
-echo "${wiz_nfs_dir} ${wiz_ip_net}/${wiz_ip_netmask}(rw,no_root_squash)" >> t.log
-echo "${wiz_nfs_dir} ${wiz_ip_net}/${wiz_ip_netmask}(rw,no_root_squash)" > ${nfs_file}
-
-/usr/sbin/exportfs -a
-
-# all is ok
-exit 10
-
-
-
diff --git a/nisautofs_wizard/.perl_checker b/nisautofs_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/nisautofs_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/nisautofs_wizard/Makefile b/nisautofs_wizard/Makefile
deleted file mode 100644
index 777f6701..00000000
--- a/nisautofs_wizard/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/nisautofs_wizard/images
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard
- install --mode=u=rw,g=r,o=r -p *.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/
- install --mode=a=r -p ./images/nisautofs.png ${prefix}/share/wizards/nisautofs_wizard/images
diff --git a/nisautofs_wizard/Nisautofs.pm b/nisautofs_wizard/Nisautofs.pm
deleted file mode 100644
index 771dde4a..00000000
--- a/nisautofs_wizard/Nisautofs.pm
+++ /dev/null
@@ -1,319 +0,0 @@
-#/usr/bin/perl -w
-# version 0.3
-#
-# Copyright (C) 2002,2005 Mandrakesoft
-#
-# Author: aginies _at_ mandriva.com
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-package MDK::Wizard::Nisautofs;
-use lib qw(/usr/lib/libDrakX);
-use strict;
-#use standalone;
-use common;
-use services;
-#use MDK::Wizard::Varspaceval;
-use MDK::Wizard::Wizcommon;
-
-
-# test root capa
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-
-#my $NISDOMAIN = $wiz->{net}->network_get("NISDOMAIN");
-my $NISDOMAIN = chomp_(`nisdomainname`);
-my @HOST = split('\.', $wiz->{net}->network_get("HOSTNAME"));
-my $HOST = @HOST[0]; # just need basename and not full qualified computer hostname (with domainaname)
-my $NIS_DIRMAKEFILE = "/var/yp/";
-my $HOMENIS = "/home/nis";
-my $NETWORKFILE = "/etc/sysconfig/network";
-my $NFSEXPORTS = "/etc/exports";
-my $AUTOMASTER = "/etc/auto.master";
-my $AUTOHOME = "/etc/auto.home";
-my $YPCONF = "/etc/yp.conf";
-
-my $o = {
- name => 'NIS Configuration Wizard',
- var => {
- NISDOMAIN => chomp_($NISDOMAIN),
- NISSERVER => chomp_($HOST),
- NIS_DIRMAKEFILE => $NIS_DIRMAKEFILE,
- HOMENIS => $HOMENIS,
- NETWORKFILE => $NETWORKFILE,
- NFSEXPORTS => $NFSEXPORTS,
- AUTOMASTER => $AUTOMASTER,
- AUTOHOME => $AUTOHOME,
- create_missing_directory => '',
- },
- needed_rpm => [ 'ypserv', 'ypbind', 'nfs-utils', 'yp-tools', 'nfs-utils-clients' ],
- defaultimage => "/usr/share/mcc/themes/default/nisautofs.png",
- init => sub {
- my ($err, $msg) = test_host_domain($SHORTHOSTNAME, $DOMAINNAME);
- if (!$err) {
- $in->ask_warn(N('Error'), $msg);
- die 'wizcancel';
- }
- },
- };
-
-$o->{pages} = {
- welcome => {
- name => N("NIS server with autofs map") . "\n\n" . N("Setup a NIS server with autofs map, auto.home and auto.master files.") . "\n\n" . N("Users automatically mount their home directory from server, when they log on a NIS client computer network."),
- no_back => 1,
- next => 'nis_server',
- },
- nis_server => {
- name => N("NIS server with autofs map") . "\n" . N("A NIS server is useful to create user, hostname database. The wizard builds autofs map, so it will provide the capabilities for NIS user to automount their home directory on a NIS client computer.") . "\n\n" . N("NIS server: name of your computer.") . "\n" . N("NIS domain: NIS domain to use (generally same as your DNS domain name)."),
- data => [
- { label => N("NIS server:"), val => $HOST },
- { label => N("NIS domainname:"), val => \$o->{var}{NISDOMAIN} },
- ],
- complete => sub {
- if ($o->{var}{NISDOMAIN} eq '(none)' || !$o->{var}{NISDOMAIN}) { return 'error_nisd' }
- },
- next => 'nis_server2',
- },
- nis_server2 => {
- name => N("Home NIS: home base directory for users on NIS server. This directory will be exported through NFS server."),
- data => [
- { label => N("Home NIS:"), val => \$o->{var}{HOMENIS} },
- { label => N("Create home NIS directory if it doesn't exist"), type => 'bool', val => \$o->{var}{create_missing_directory} },
- ],
- complete => sub {
- if (!-d $o->{var}{HOMENIS} and $o->{var}{create_missing_directory}) {
- mkdir_p($o->{var}{HOMENIS});
- } elsif (!-d $o->{var}{HOMENIS}) {
- $in->ask_warn(N("Warning"), N("Directory doesn't exist. Please create it manually."));
- return 1; }
- },
- next => 'summaryserver',
- },
- summaryserver => {
- name => N("The wizard will set your NIS server with autofs map"),
- data => [
- { label => N("NIS server:"), val_ref => \$HOST },
- { label => N("Home NIS:"), val_ref => \$o->{var}{HOMENIS} },
- { label => N("NIS domainname:"), val_ref => \$o->{var}{NISDOMAIN} },
- { label => N("NIS directory:"), val_ref => \$o->{var}{NIS_DIRMAKEFILE} },
-# { label => N("Network file:"), val_ref => \$o->{var}{NETWORKFILE} },
-# { label => N("NFS exports:"), val_ref => \$o->{var}{NFSEXPORTS} },
-# { label => N("Auto master:"), val_ref => \$o->{var}{AUTOMASTER} },
-# { label => N("Auto home:"), val_ref => \$o->{var}{AUTOHOME} },
- ],
- post => \&do_it_server,
- next => 'endserver',
- },
- error_nisd => {
- name => N("Error: nisdomainname should not be 'none' or 'localdomain'.") . "\n\n" . N("Please adjust it."),
- no_back => 1,
- next => 'nis_server',
- },
- endserver => {
- name => N("Congratulations"),
- data => [ { label => N("The wizard successfully configured your machine to be a NIS server with autofs map.") } ],
- no_back => 1,
- end => 1,
- next => 0
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
- };
-
-
-sub test_set {
- if (member($o->{var}{NISDOMAIN}, qw(localdomain (none)))) { return 'error_nisd' }
- !-d $o->{var}{HOMENIS} or return 'error_dir';
- !-d $o->{var}{NIS_DIRMAKEFILE} or return 'error_dir';
-}
-# update /etc/sysconfig/network
-sub update_network {
- save_config($NETWORKFILE);
- if (any { /NISDOMAIN/ } cat_($NETWORKFILE)) {
- substInFile { s/NISDOMAIN.*/NISDOMAIN=$o->{var}{NISDOMAIN}/g } $NETWORKFILE;
- } else {
- append_to_file($NETWORKFILE, "NISDOMAIN=$o->{var}{NISDOMAIN}\n");
- }
-}
-
-# Setting nisdomainname
-sub set_nisdomain {
- system("nisdomainname $o->{var}{NISDOMAIN}");
-}
-
-
-sub nfs_home_nis {
- # test directory
- $HOMENIS = $o->{var}{HOMENIS};
- if (-d $HOMENIS) {
- print " - $HOMENIS directory exist\n";
- } else {
- print " - Creating $HOMENIS directory\n";
- mkdir_p($HOMENIS);
- }
-
- # check nis home
- if (any { /$HOMENIS/ } cat_($NFSEXPORTS)) {
- print " - " . $NFSEXPORTS . " ready\n";
- } else {
- print " - Adjusting " . $NFSEXPORTS . "\n";
- append_to_file($NFSEXPORTS, "$HOMENIS *(async,rw,no_root_squash)\n");
- }
-}
-
-# configure /etc/auto.*
-sub configure_auto {
- $HOMENIS = $o->{var}{HOMENIS};
- save_config($AUTOMASTER);
- my $nisserver = chomp_($o->{var}{NISSERVER});
- output($AUTOMASTER, <<EOF);
-$HOMENIS auto.home --timeout=60
-EOF
-
- save_config($AUTOHOME);
- output($AUTOHOME, <<EOF);
-* -rw,nfs,soft,intr,nosuid,rsize=8192,wsize=8192 $nisserver:$HOMENIS/&
-EOF
-}
-
-sub adjust_makefile {
-# Makefile parameter
- print " - Updating " . $NIS_DIRMAKEFILE . " to add autofs\n";
- mkdir_p('/etc/mail');
- system('touch /etc/mail/aliases');
- substInFile {
- s!^ALIASES!#ALIASES=/etc/aliases!g;
- s/^all.*/all: passwd group shadow hosts rpc services netid protocols auto.master auto.home/g;
- } $NIS_DIRMAKEFILE . '/Makefile';
-}
-
-# create yp base
-sub make_yp {
- system("make -C $NIS_DIRMAKEFILE");
-}
-
-sub needed_service {
- my ($service) = @_;
- if (services::is_service_running($service)) {
- services::restart($service);
- } else { services::start($service) }
-}
-
-sub get_nis_users {
- my @unwanted = qw(install maui nobody mpi);
- my @users;
- local *PASS;
- open(PASS, "ypcat passwd|") or die " cant exec ypcat passwd!";
- while (<PASS>) {
- my ($login) = split(':');
- if (!member($login, @unwanted)) {
- push(@users, $login);
- }
- }
- close(PASS);
- [ @users ];
-}
-
-sub update_yp {
- my ($nd, $yps) = @_;
- save_config($YPCONF);
- output($YPCONF, <<EOF);
-# /etc/yp.conf - ypbind configuration file
-# domain NISDOMAIN server HOSTNAME
-# Use server HOSTNAME for the domain NISDOMAIN.
-#domain NISDOMAIN broadcast
-# Use broadcast on the local net for domain NISDOMAIN
-#
-#ypserver HOSTNAME
-# Use server HOSTNAME for the local domain. The
-# IP-address of server must be listed in /etc/hosts.
-#
-domain $nd server $yps
-EOF
-}
-
-sub test_autofile {
- map { if (-e $_) { rm_rf($_) }; $_ } $AUTOHOME, $AUTOMASTER;
-}
-
-sub save_config {
- my ($old) = @_;
- my $DATE = chomp_(`date +%d-%m-20%y`);
- if (-f $old) {
- cp_af($old, $old . '.' . $DATE);
- }
- return($old . '.' . $DATE);
-}
-
-sub update_network_nisdomain {
- my ($nd) = @_;
- my $nf = cluster_commonconf::system_network()->{NETWORKFILE};
- my %conf = getVarsFromSh($nf);
- save_config($nf);
- setVarsInSh($nf, { %conf, NISDOMAIN => $nd });
-}
-
-sub update_nsswitch {
- substInFile {
- s/automount:.*/automount: nis nisplus files/g;
- s/hosts.*/hosts: dns nis files/;
- } '/etc/nsswitch.conf';
-}
-
-sub uninstall_rpm {
- my ($rpm) = @_;
- system("urpme $rpm --auto");# if (system('/bin/rpm', '>/dev/null', '-q', $rpm));
-}
-
-sub do_it_server {
- return if $::testing;
- my $in = 'interactive'->vnew('su', 'nisautofsconfig');
- my $w = $in->wait_message(N("NIS with Autofs map"), N("Configuring your system to be a NIS server with Autofs map..."));
-# system("urpme --auto autofs") if (system("/bin/rpm -q autofs >/dev/null"));
- uninstall_rpm('autofs');
- # configure autofs to fit nis
- configure_auto();
- # set correct nis
- set_nisdomain();
- # create all make file needed
- adjust_makefile();
- make_yp();
- # update client conf file (also on server)
- update_yp(chomp_($o->{var}{NISDOMAIN}), chomp_($HOST));
- # update conf file
- update_network();
- # update nsswitch.conf
- update_nsswitch();
- # update nfs to fit nis
- nfs_home_nis();
- # restart all needed services
- needed_service($_) foreach qw(ypserv nfs);
- undef $w;
- needed_service("ypbind");
- check_started($_) foreach qw(ypserv nfsd);
-}
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-1;
diff --git a/postfix_wizard/.perl_checker b/postfix_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/postfix_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/postfix_wizard/Makefile b/postfix_wizard/Makefile
deleted file mode 100644
index 154f7b60..00000000
--- a/postfix_wizard/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/postfix_wizard
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/postfix_wizard/scripts
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/postfix_wizard/images
- install --mode=u=rw,g=r,o=r -p postfix.wiz ${prefix}/share/wizards/postfix_wizard
- install --mode=u=rw,g=r,o=r -p scripts/main.cf.dist.default ${prefix}/share/wizards/postfix_wizard
- install --mode=u=rwx,g=rx,o=rx -p scripts/Postfixconf.pm ${prefix}/share/wizards/postfix_wizard/scripts
- install --mode=u=rwx,g=rx,o=rx -p scripts/*.sh ${prefix}/share/wizards/postfix_wizard/scripts
- install --mode=u=rwx,g=rx,o=rx -p images/*.png ${prefix}/share/wizards/postfix_wizard/images
-
-run:
- (su -c "make install; unset WIZPATH; export DEBUG_WIZ='/dev/pts/0'; wiz /usr/share/wizards/time_wizard/time.wiz")
-
-desktop:
- cp -f desktop_data/time\ wiz ${HOME}/Desktop
- cp -f desktop_data/util1.gif ${HOME}/.kde/share/icons/
diff --git a/postfix_wizard/Postfix.pm b/postfix_wizard/Postfix.pm
deleted file mode 100755
index 044e27db..00000000
--- a/postfix_wizard/Postfix.pm
+++ /dev/null
@@ -1,404 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-
-# Copyright (C) 2002, 2005 Mandrakesoft
-#
-# Authors: Antoine Ginies <aginies at mandriva.com>
-# Arnaud Desmons <adesmons@mandrakesoft.com>
-# Florent Villard <warly@mandrakesoft.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Postfix;
-use strict;
-use lib qw(/usr/lib/libDrakX); # required for service package
-
-use common;
-use MDK::Wizard::Wizcommon;
-use MDK::Wizard::Varspaceval;
-
-use Libconf qw(:functions);
-use Libconf::Glueconf::Postfix::Main_cf;
-
-
-my $default_conf = "/etc/postfix/main.cf.dist";
-# provide a default postfix configuration file
-!-d mkdir("/etc/postfix/") and mkdir("/etc/postfix/");
-!-f $default_conf and cp_af("/usr/share/wizards/postfix_wizard/scripts/main.cf.dist.default", $default_conf);
-if (!-f "/etc/postfix/main.cf") { cp_af($default_conf, "/etc/postfix/main.cf") }
-my $postfix = new Libconf::Glueconf::Postfix::Main_cf({ filename => '/etc/postfix/main.cf', });
-use Data::Dumper;
-print Dumper($postfix);
-
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-my $wiz_domain_name = $wiz->{net}->network_get("DOMAINNAME");
-my $wiz_host_name = $wiz->{net}->network_get("HOSTNAME");
-my $wiz_postfix_etc = "/etc/sysconfig/wizard_postfix";
-
-my ($IPSERVER_MASQ) = `/sbin/ip addr show dev eth1` =~ /^\s*inet\s+(\d+\.\d+\.\d+)\.\d+/m;
-
-my $o = {
- name => N("Postfix wizard"),
- var => {
- wiz_myhostname => '',
- wiz_mydomain => '',
- wiz_myorigin => '',
- wiz_inet_interfaces => '',
- wiz_mydestination => '',
- wiz_mynetworks => '',
-
- wiz_smtpd_helo_required => '',
- wiz_disable_vrfy_command => '',
-
- wiz_maximal_queue_lifetime => '',
- wiz_message_size_limit => '',
- wiz_smtpd_banner => '',
-
- wiz_debug_peer_level => '',
- wiz_debugger_command => '',
- wiz_delay_warning_time => '',
-
- wiz_sendmail_path => '',
- wiz_newaliases_path => '',
- wiz_mailq_path => '',
- wiz_setgid_group => '',
- wiz_manpage_directory => '',
- wiz_sample_directory => '',
- wiz_readme_directory => '',
- wiz_html_directory => '',
-
- wiz_masquerade_domains => '',
-
- wiz_mail_masquerade => '',
- wiz_relayhost => '',
- wiz_relay_domains => '',
- },
- init => sub {
- check_sendmail();
- my $t = any { /$wiz_host_name/ } cat_("/etc/hosts");
- if ($t == 0) {
- return 0, N("Error, can't find your hostname in /etc/hosts. Exiting. Please launch drakconnect and choose static IP address.");
- }
- 1;
- },
- needed_rpm => [ 'postfix' ],
- defaultimage => "/usr/share/mcc/themes/default/postfix-mdk.png",
- };
-
-my %type = (
- 1 => N("Main mail server"),
- 2 => N("Relay mail server"),
- );
-
-my %understanding = (
- 1 => N("Newbie - classical options"),
- 2 => N("Expert - advanced options"),
- );
-
-my @yesorno = qw(yes no); push @yesorno, "";
-
-$o->{pages} = {
- welcome => {
- name => N("Internet mail configuration wizard") . "\n\n" . N("This wizard will help you configure a Postfix mail server or a Postfix mail relay."),
- no_back => 1,
- pre => sub {
- $postfix->{relayhost} and $o->{var}{wiz_type} = 2;
- if (-f $wiz_postfix_etc) {
- $in->ask_warn(N("Information"), N("It seems you previously setup a Postfix configuration. This wizard will re-read your old configuration, and show you the Postfix server type you choose")) or $in->exit;
- my $data = cat_($wiz_postfix_etc);
- # detect old Postfix type
- my ($old_type) = $data =~ /type=(\d)/;
- $o->{var}{wiz_type} = chomp_($old_type);
- } else { $o->{var}{wiz_type} = 1 }
- },
- data => [
- { label => N("What do you want to do:"), val => \$o->{var}{wiz_type}, list => [ keys %type ], format => sub { $type{$_[0]} } },
- ],
- next => 'global_config',
- },
- understanding => {
- name => N('Now I need to know your understanding in Postfix server configuration'),
- data => [
- { label => N("What kind of user are you:"), val => \$o->{var}{wiz_understanding}, list => [ keys %understanding ], format => sub { $understanding{$_[0]} } },
- ],
- no_back => 1,
- next => 'global_config',
- },
- global_config => {
- name => N('Global postfix configuration'),
- pre => sub {
- $o->{var}{wiz_smtpd_banner} ||= $postfix->{smtpd_banner};
- $o->{var}{wiz_myhostname} ||= $postfix->{myhostname} or $o->{var}{wiz_myhostname} = $wiz_host_name;
- $o->{var}{wiz_mydomain} ||= $postfix->{mydomain} or $o->{var}{wiz_mydomain} = $wiz_domain_name;
- $o->{var}{wiz_myorigin} ||= $postfix->{myorigin};
- },
- post => sub {
- if ($o->{var}{wiz_type} == 1) {
- return 'main_server' ;
- } else {
- return 'relay_server';
- }
- },
- data => [
- { label => N('Smtpd banner:'), val => \$o->{var}{wiz_smtpd_banner}, help => 'You MUST specify $myhostname at the start of the text. That is an RFC requirement. ie: $myhostname ESMTP $mail_name ($mail_version) (Mandriva Linux)' },
- { label => N('Hostname:'), val => \$o->{var}{wiz_myhostname}, help => N('The myhostname parameter specifies the internet hostname of this mail system. ie: myhostname = myhostname') },
- { label => N('Domain:'), val => \$o->{var}{wiz_mydomain}, help => N('The mydomain parameter specifies the local internet domain name. ie: mydomain = mydomain') },
- { label => N('Origin:'), val => \$o->{var}{wiz_myorigin}, help => N('The myorigin parameter specifies the domain that locally-posted mail appears to come from. ie: myorigin = $myhostname') },
- ],
- complete => sub {
- if (!$o->{var}{wiz_smtpd_banner}) {
- $in->ask_warn(N('Error'), N('Please provide an Smtpd banner.')); return 1; }
- if (!$o->{var}{wiz_myhostname}) {
- $in->ask_warn(N('Error'), N('You must provide an internet hostname of this mail system.')); return 1; }
- if (!$o->{var}{wiz_mydomain}) {
- $in->ask_warn(N('Error'), N('You must specify the local internet domain name.')); return 1; }
- },
- },
- main_server => {
- name => N('Main Postfix server') . "\n\n" . N('helo_required: require that a remote SMTP client introduces itself at the beginning of an SMTP session with the HELO or EHLO command.') . "\n" . N('Verify command: this stops some techniques used to harvest email addresses.'),
- pre => sub {
- $o->{var}{wiz_smtpd_helo_required} ||= $postfix->{smtpd_helo_required};
- $o->{var}{wiz_disable_vrfy_command} ||= $postfix->{disable_vrfy_command};
- $o->{var}{wiz_masquerade_domains} ||=$postfix->{masquerade_domains};
- },
- data => [
- { label => N('helo required:'), val => \$o->{var}{wiz_smtpd_helo_required}, list_ref => \@yesorno },
- { label => N('Disable verify command:'), val => \$o->{var}{wiz_disable_vrfy_command}, list_ref => \@yesorno },
- { label => N('Masquerade domains'), val => \$o->{var}{wiz_masquerade_domains}, help => N('This should be chosen consistently with the address you use for incoming mail. Address masquerading is a method to hide all hosts inside a domain behind their mail gateway, and to make it appear as if the mail comes from the gateway itself, instead of from individual machines.') },
- ],
- complete => sub {
- if ($o->{var}{wiz_masquerade_domains} !~ /\w+\.\w+\s\w+\.\w+$/ and $o->{var}{wiz_masquerade_domains}) {
- $in->ask_warn(N("Error"), N("Masquerade should be a valid domain name such as \"domain_to_masquerade.com with_this_domain.com\"!"));
- return 1;
- } else { return 0; };
- },
- next => 'message_config',
- },
- relay_server => {
- name => N('Relay server') . N('Relay domains: what destination domains (and subdomains thereof) this system will relay mail to.') . "\n" ,
- pre => sub {
- $o->{var}{wiz_relayhost} ||= $postfix->{relayhost};
- $postfix->{relay_domains} and $o->{var}{wiz_relay_domains} = $postfix->{relay_domains} or $o->{var}{wiz_relay_domains} = $wiz_domain_name;
- },
- data => [
- { label => N('Relay host:'), val => \$o->{var}{wiz_relayhost}, help => 'The default host to send non-local mail to when no entry is matched in the optional transport(5) table. ie: relayhost = [gateway.my.domain], relayhost = uucphost, relayhost = [an.ip.add.ress].' },
- { label => N('Relay domains:'), val => \$o->{var}{wiz_relay_domains}, help => N('What destination domains (and subdomains thereof) this system will relay mail to. ie: mydomain.com') },
- ],
- complete => sub { if (!$o->{var}{wiz_relayhost}) { $in->ask_warn(N('Error'), N('Need a relayhost.')); return 1; } else { return 0; }; },
- next => 'message_config',
- },
- network_config => {
- name => N('Network config'),
- pre => sub {
- $postfix->{inet_interfaces} and $o->{var}{wiz_inet_interfaces} = $postfix->{inet_interfaces} or $o->{var}{wiz_inet_interfaces} = 'all';
- $postfix->{mydestination} and $o->{var}{wiz_mydestination} = $postfix->{mydestination} or $o->{var}{wiz_mydestination} = "\$myhostname, localhost.\$mydomain";
- my $mynetworks;
- $IPSERVER_MASQ and $mynetworks = "127.0.0.0/32, " . $IPSERVER_MASQ . ".0/24" or $mynetworks = "127.0.0.0/32";
- $postfix->{mynetworks} and $o->{var}{wiz_mynetworks} = $postfix->{mynetworks} or $o->{var}{wiz_mynetworks} = $mynetworks;
- $o->{var}{wiz_mynetworks_style} ||= $postfix->{mynetworks_style};
- },
- data => [
- { label => N('inet interfaces:'), val => \$o->{var}{wiz_inet_interfaces}, help => N('The network interface addresses that this mail system receives mail on. By default, the software claims all active interfaces on the machine. ie: all') },
- { label => N('my destination:'), val => \$o->{var}{wiz_mydestination}, help => N('The list of domains that are delivered via the $local_transport mail delivery transport. ie: $myhostname, localhost.$mydomain, /etc/postfix/destinations') },
- { label => N('my networks:'), val => \$o->{var}{wiz_mynetworks}, help => N('The list of trusted SMTP clients. ie: 127.0.0.0/32, 192.168.1.0/24') },
- ],
- complete => sub { if (!$o->{var}{wiz_mynetworks}) { $in->ask_warn(N('Error'), N('This is the list of trusted SMTP clients. For security reason, please provide one. ie: 127.0.0.0/32, 192.168.1.0/24')); return 1; } else { return 0; }; },
- post => sub {
- if ($o->{var}{wiz_type} == 1) {
- return 'summary_main' ;
- } else {
- return 'summary_relay';
- }
- }
- },
- message_config => {
- name => N('Message options') . N('Various options to configure your message queue, delay, size...'),
- pre => sub {
- $postfix->{maximal_queue_lifetime} and $o->{var}{wiz_maximal_queue_lifetime} = $postfix->{maximal_queue_lifetime} or $o->{var}{wiz_maximal_queue_lifetime} = "5d";
- $postfix->{message_size_limit} and $o->{var}{wiz_message_size_limit} = $postfix->{message_size_limit} or $o->{var}{wiz_message_size_limit} = "10240000";
- $o->{var}{wiz_delay_warning_time} ||= $postfix->{delay_warning_time} or $postfix->{delay_warning_time} = "2h";
- },
- data => [
- { label => N('Maximal queue life:'), val => \$o->{var}{wiz_maximal_queue_lifetime}, help => N('Determines how long a message should stay in the queue before it is deemed undeliverable. The default is five days (5d)') },
- { label => N('Message size limit:'), val => \$o->{var}{wiz_message_size_limit}, help => N('Maximum size of a message in Kb') },
- { label => N('Delay warning time:'), val => \$o->{var}{wiz_delay_warning_time}, help => N('The delay_warning_time specifies after how many hours a warning is sent that mail has not yet been delivered.') },
- ],
- next => 'network_config',
- },
- error_sendmail => {
- name => N("Error, sendmail is installed. Please remove it before installing or configuring Postfix"),
- no_back => 1,
- next => 0,
- end => 1,
- },
- summary_relay => {
- name => N("Configuring your relay mail server") . "\n\n" . N("The wizard collected the following parameters needed to configure your relay mail server:") . "\n\n" . N("To accept these values, and configure your server, click the next button or use the back button to correct them."),
- data => [
- { label => N('Relay host:'), val_ref => \$o->{var}{wiz_relayhost} },
- { label => N('Relay domains:'), val_ref => \$o->{var}{wiz_relay_domains} },
- ],
- post => \&do_it_relay_server,
- next => 'end'
- },
- summary_main => {
- name => N("The wizard will now configure your Postfix mail server."),
- data => [
- { label => N('inet interfaces:'), val_ref => \$o->{var}{wiz_inet_interfaces} },
- { label => N('my destination:'), val_ref => \$o->{var}{wiz_mydestination} },
- { label => N('my networks:'), val_ref => \$o->{var}{wiz_mynetworks} },
- ],
- post => \&do_it_main_server,
- next => 'end'
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Postfix Mail server."),
- post => sub {
- store_postfix_type($o->{var}{wiz_type});
- },
- no_back => 1,
- end => 1,
- next => 0
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Please relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
-};
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-sub check_sendmail {
- my $in = 'interactive'->vnew('su', 'Check sendmail');
- my $w = $in->wait_message(N("Postfix Server"), N("removing Sendmail to avoid conflict...."));
- my $test = any { /sendmail/ } system("rpm -q sendmail");
- !$test or return 'error_sendmail';
- undef $w;
-}
-
-sub postfix_options {
- # global
- $o->{var}{wiz_myhostname} and $postfix->{myhostname} = $o->{var}{wiz_myhostname};
- $o->{var}{wiz_mydomain} and $postfix->{mydomain} = $o->{var}{wiz_mydomain};
- $o->{var}{wiz_myorigin} and $postfix->{myorigin} = $o->{var}{wiz_myorigin};
- $o->{var}{wiz_inet_interfaces} and $postfix->{inet_interfaces} = $o->{var}{wiz_inet_interfaces};
- $o->{var}{wiz_mydestination} and $postfix->{mydestination} = $o->{var}{wiz_mydestination};
- $o->{var}{wiz_mynetworks} and $postfix->{mynetworks} = $o->{var}{wiz_mynetworks};
- $o->{var}{wiz_smtpd_banner} and $postfix->{smtpd_banner} = $o->{var}{wiz_smtpd_banner};
-
- # not defined but wanted
- $postfix->{debug_peer_level} or $postfix->{debug_peer_level} = "1";
- #$postfix->{debugger_command} or $postfix->{debugger_command} = "PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5";
- $postfix->{sendmail_path} or $postfix->{sendmail_path} = "/usr/sbin/sendmail.postfix";
- $postfix->{newaliases_path} or $postfix->{newaliases_path} = "/usr/bin/newaliases.postfix";
- $postfix->{mailq_path} or $postfix->{mailq_path} = "/usr/bin/mailq.postfix";
- $postfix->{setgid_group} or $postfix->{setgid_group} = "postdrop";
- $postfix->{alias_maps} or $postfix->{alias_maps} = "hash:/etc/postfix/aliases";
- $postfix->{mail_spool_directory} or $postfix->{mail_spool_directory} = "/var/spool/mail";
- $postfix->{alias_database} or $postfix->{alias_database} = "hash:/etc/postfix/aliases";
- $postfix->{command_directory} or $postfix->{command_directory} = "/usr/sbin";
- $postfix->{queue_directory} or $postfix->{queue_directory} = "/var/spool/postfix";
- $postfix->{daemon_directory} or $postfix->{daemon_directory} = "/usr/lib/postfix";
- $postfix->{mail_owner} or $postfix->{mail_owner} = "postfix";
-}
-
-sub store_postfix_type {
-# write config file to store Postfix type
- my ($type) = @_;
- output($wiz_postfix_etc, <<EOF);
-# 1 = Main server
-# 2 = Relay
-# 3 = mail server + fetchmail
-EOF
-
- append_to_file($wiz_postfix_etc, "type=$type\n");
-}
-
-sub save_config {
- my @conf = qw(/etc/postfix/aliases
- /etc/postfix/canonical
- /etc/postfix/main.cf
- /etc/postfix/master.cf
- /etc/postfix/virtual);
- foreach (@conf) {
- -f $_ and MDK::Common::cp_af($_, $_.".orig");
- }
-}
-
-sub cmd_needed {
- system("/usr/sbin/postmap -r -w /etc/postfix/canonical");
- system("/usr/sbin/postmap /etc/postfix/virtual");
- system("/usr/sbin/postalias /etc/postfix/aliases");
- system("/usr/sbin/postfix check");
- $postfix->write_conf("/etc/postfix/main.cf");
- require services;
- if (services::is_service_running('postfix')) {
- services::restart('postfix');
- } else {
- services::start('postfix');
- }
-}
-
-sub do_it_relay_server {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'postfix configuration');
- my $w = $in->wait_message(N("Postfix Server"), N("Configuring your Postfix server....."));
- save_config();
-
- postfix_options();
- $o->{var}{wiz_relayhost} and $postfix->{relayhost} = $o->{var}{wiz_relayhost};
- $o->{var}{wiz_relay_domains} and $postfix->{relay_domains} = $o->{var}{wiz_relay_domains};
-
- # remove server unwanted options
- $postfix->{smtpd_helo_required} and delete $postfix->{smtpd_helo_required};
- $postfix->{disable_vrfy_command} and delete $postfix->{disable_vrfy_command};
- $postfix->{masquerade_domains} and delete $postfix->{masquerade_domains};
-
- cmd_needed();
- undef $w;
- check_started('master');
-}
-
-sub do_it_main_server {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'postfix configuration');
- my $w = $in->wait_message(N("Postfix Server"), N("Configuring your Postfix server....."));
- save_config();
-
- postfix_options();
- $o->{var}{wiz_smtpd_helo_required} and $postfix->{smtpd_helo_required} = $o->{vawiz_smtpd_helo_required};
- $o->{var}{wiz_disable_vrfy_command} and $postfix->{disable_vrfy_command} = $o->{var}{wiz_disable_vrfy_command};
- $o->{var}{wiz_maximal_queue_lifetime} and $postfix->{maximal_queue_lifetime} = $o->{var}{wiz_maximal_queue_lifetime};
- $o->{var}{wiz_message_size_limit} and $postfix->{message_size_limit} = $o->{var}{wiz_message_size_limit};
- $o->{var}{wiz_masquerade_domains} and $postfix->{masquerade_domains} = $o->{var}{wiz_masquerade_domains};
- $o->{var}{wiz_delay_warning_time} and $postfix->{delay_warning_time} = $o->{var}{wiz_delay_warning_time};
-
- # remove relay options
- $postfix->{relayhost} and delete $postfix->{relayhost};
- $postfix->{relay_domains} and delete $postfix->{relay_domains};
-
- cmd_needed();
- undef $w;
- check_started('master');
-}
-
-1;
diff --git a/postfix_wizard/postfix_main.txt b/postfix_wizard/postfix_main.txt
deleted file mode 100644
index e10f5d9d..00000000
--- a/postfix_wizard/postfix_main.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-queue_directory = /var/spool/postfix
-command_directory = /usr/sbin
-daemon_directory = /usr/lib/postfix
-
-mail_owner = postfix
-myhostname = test.mdk.com
-mydomain = balvy.loc
-myorigin = $myhostname
-inet_interfaces = all
-mydestination = $myhostname, localhost.$mydomain, /etc/postfix/destinations
-local_recipient_maps =
-
-unknown_local_recipient_reject_code = 450
-mynetworks = 127.0.0.0/32, 192.168.1.0/24
-
-alias_maps = hash:/etc/postfix/aliases
-alias_database = hash:/etc/postfix/aliases
-
-mail_spool_directory = /var/spool/mail
-mailbox_transport = cyrus
-
-header_checks = pcre:/etc/postfix/header_checks
-body_checks = pcre:/etc/postfix/body_checks
-
-smtpd_helo_required = yes
-disable_vrfy_command = yes
-smtpd_recipient_restrictions =
- reject_invalid_hostname,
- reject_unknown_sender_domain,
- reject_unknown_recipient_domain,
- permit_mynetworks,
- reject_unauth_destination,
- reject_rbl_client titi.toto.com,
- permit
-smtpd_data_restrictions =
- reject_unauth_pipelining,
- permit
-
-maximal_queue_lifetime = 2d
-message_size_limit = 20000000
-smtpd_banner = Welcom srv
-
-debug_peer_level = 2
-debugger_command =
- PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
- xxgdb $daemon_directory/$process_name $process_id & sleep 5
-delay_warning_time = 4
-
-sendmail_path = /usr/sbin/sendmail.postfix
-newaliases_path = /usr/bin/newaliases.postfix
-mailq_path = /usr/bin/mailq.postfix
-setgid_group = postdrop
-manpage_directory = /usr/share/man
-sample_directory = /usr/share/doc/postfix-2.1.1/samples
-readme_directory = /usr/share/doc/postfix-2.1.1/README_FILES
-
-masquerade_domains = guibland.com
-default_destination_concurrency_limit = 50
-default_destination_recipient_limit = 50
-content_filter=smtp-filter:[127.0.0.1]:10025
-smtp-amavis_destination_concurrency_limit=2
-html_directory = /usr/share/doc/postfix-2.1.1/html
-content_filter = lmtp-filter:127.0.0.1:10025
-receive_override_options = no_address_mappings
diff --git a/postfix_wizard/postfix_relais.txt b/postfix_wizard/postfix_relais.txt
deleted file mode 100644
index a2d34df8..00000000
--- a/postfix_wizard/postfix_relais.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-queue_directory = /var/spool/postfix
-command_directory = /usr/sbin
-daemon_directory = /usr/lib/postfix
-mail_owner = postfix
-
-mydomain = mdk.com
-myorigin = $mydomain
-
-mynetworks = 127.0.0.0/8, 192.168.1.0/24
-
-# spécifier la machine sur le réseau local vers laquelle relayer les mails
-relayhost = ip_relay
-# spécifier les domaines à relayer
-relay_domains = guibland.com
-
-unknown_local_recipient_reject_code = 450
-#unknown_local_recipient_reject_code = 550
-
-alias_maps = hash:/etc/postfix/aliases
-
-smtpd_banner = Welcome srv
-
-debug_peer_level = 2
-debugger_command =
- PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
- xxgdb $daemon_directory/$process_name $process_id & sleep 5
-delay_warning_time = 4
-
-sendmail_path = /usr/sbin/sendmail.postfix
-newaliases_path = /usr/bin/newaliases.postfix
-mailq_path = /usr/bin/mailq.postfix
-setgid_group = postdrop
-manpage_directory = /usr/share/man
-sample_directory = /usr/share/doc/postfix-2.1.1/samples
-readme_directory = /usr/share/doc/postfix-2.1.1/README_FILES
-alias_database = hash:/etc/postfix/aliases
-
-smtpd_recipient_restrictions = reject_unauth_destination
-smtpd_sender_restrictions = permit_mynetworks
-
-message_size_limit = 20000000
-
-masquerade_domains = $mydomain
-html_directory = /usr/share/doc/postfix-2.1.1/html
diff --git a/postfix_wizard/scripts/Postfixconf.pm b/postfix_wizard/scripts/Postfixconf.pm
deleted file mode 100644
index e34234d9..00000000
--- a/postfix_wizard/scripts/Postfixconf.pm
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/perl
-
-package Postfixconf;
-use lib '/usr/lib/libDrakX';
-require "__WIZ_HOME__/common/scripts/Vareqval.pm";
-require "__WIZ_HOME__/common/scripts/IFCFG.pm";
-use MDK::Common;
-use services;
-use strict;
-
-my $o = IFCFG->new();
-my $wiz_domain_name = $o->network_get("DOMAINNAME");
-my $wiz_host_name = $o->network_get("HOSTNAME");
-
-sub check_masquerade {
- $ENV{wiz_mail_masquerade} or return 1;
- $ENV{wiz_mail_masquerade} =~ /@(\S+)$/ or return 1;
- return 10
-}
-
-sub check_relay {
- $ENV{wiz_ext_mail_relay} or return 1;
- $ENV{wiz_ext_mail_relay} =~ /(\S+)\.(\S+)$/ or return 1;
- return 10;
-}
-
-sub get_mail_masquerade {
- my $login = `logname`;
- my $relayhost = `/usr/sbin/postconf -h relayhost`;
- chomp($relayhost);
- ($relayhost) = $relayhost =~ /.*\.(.*\..*)/;
- !length $relayhost and $relayhost = $wiz_domain_name;
- chomp($login);
- "$login\@$relayhost";
-}
-
-sub get_mail_relay {
- my $relayhost = `/usr/sbin/postconf -h relayhost`;
- chomp $relayhost;
- !length $relayhost and $relayhost = "smtp.$wiz_domain_name";
- $relayhost;
-}
-
-sub do_it {
- my @conf = qw(/etc/postfix/aliases
- /etc/postfix/canonical
- /etc/postfix/main.cf
- /etc/postfix/master.cf
- /etc/postfix/virtual);
- foreach (@conf) {
- (-f $_) and MDK::Common::cp_af($_, $_.".orig");
- }
- @conf = ("myhostname = $wiz_host_name",
- 'myorigin = $mydomain',
- 'inet_interfaces = all',
- 'mydestination = $myhostname, localhost.$mydomain',
- 'masquerade_domains = $mydomain',
- 'alias_maps = hash:/etc/postfix/aliases',
- 'alias_database = hash:/etc/postfix/aliases',
- 'virtual_maps = hash:/etc/postfix/virtual',
- 'canonical_maps = hash:/etc/postfix/canonical',
- "relayhost = $ENV{wiz_ext_mail_relay}"
- );
- foreach (@conf) {
- system("/usr/sbin/postconf -e \'$_\'");
- }
- if (defined $ENV{wiz_ext_mail_relay}) {
- my $file = "/etc/postfix/canonical";
- my $canon = "\n\@$wiz_domain_name $ENV{wiz_mail_masquerade}";
- my $t;
- foreach (cat_($file)) {
- if (/^\s*(?!\#)\s*\@$wiz_domain_name.*/) {
- $t = $_;
- last;
- }
- }
- if ($t) { substInFile { s|$t|\#$&$canon|} $file }
- else { append_to_file($file, $canon) }
- }
- system("/usr/sbin/postmap /etc/postfix/canonical");
- system("/usr/sbin/postmap /etc/postfix/virtual");
- system("/usr/sbin/postalias /etc/postfix/aliases");
- system("/usr/sbin/postfix check");
- if (services::is_service_running('postfix')) {
- services::restart('postfix')
- } else {
- services::start('postfix')
- }
- services::is_service_running('xinetd') and services::restart('xinetd');
- 10;
-}
-
-1;
diff --git a/postfix_wizard/scripts/check_masquerade.sh b/postfix_wizard/scripts/check_masquerade.sh
deleted file mode 100755
index ad0559c6..00000000
--- a/postfix_wizard/scripts/check_masquerade.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard postfix configuration
-#
-# checking if the provided domain value is correct :
-# strip the @, need at least a dot
-
-if [ -z "${wiz_mail_masquerade}" ] ;then
- echo_debug "wiz_mail_masquerade is empty, should not."
- exit 1
-fi
-
-test=`echo ${wiz_mail_masquerade} |sed -e '/@/{s/^[^@]*@\([^@]*\)$/\1/;}' |grep "\."`
-echo_debug "test of masquerading domain : ${test}"
-
-if [ -z "${test}" ] ;then
- echo_debug "domain empty, should not."
- exit 1
-fi
-if `echo ${test}| grep -q ' '` ;then
- echo_debug "bad domain : $test"
- exit 1
-fi
-
-# all seems to be ok
-exit 10
-
-
-
-
diff --git a/postfix_wizard/scripts/check_relay.sh b/postfix_wizard/scripts/check_relay.sh
deleted file mode 100755
index c7a2368f..00000000
--- a/postfix_wizard/scripts/check_relay.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard postfix configuration
-#
-# checking if the provided hostname of relay value is correct
-#
-# at least a dot, strip @
-
-
-if [ -z "${wiz_ext_mail_relay}" ]; then
- echo_debug "wiz_ext_mail_relay is empty, should not."
- exit 1
-fi
-
-# (no need to skip white space), stripping @, need dot
-
-test=`echo ${wiz_ext_mail_relay} |sed -e '/@/{s/^[^@]*@\([^@]*\)$/\1/;}'|grep "\."`
-echo_debug "test of relay domain : ${test}"
-
-if [ -z "${test}" ] ;then
- echo_debug "relay empty, should not."
- exit 1
-fi
-
-# all seems to be ok
-exit 10
-
diff --git a/postfix_wizard/scripts/compute_mail_relay.sh b/postfix_wizard/scripts/compute_mail_relay.sh
deleted file mode 100755
index b2fc35e6..00000000
--- a/postfix_wizard/scripts/compute_mail_relay.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard postfix configuration
-#
-# echo on stdout the correct value of wiz_ext_mail_relay
-# (strip @)
-
-
-#stripping @, need dot
-
-test=`echo ${wiz_ext_mail_relay} |sed -e '/@/{s/^[^@]*@\([^@]*\)$/\1/;}' -e 's! .*$!!'`
-echo_debug "relay domain : ${test}"
-
-echo ${test}
-
-# all seems to be ok
-exit 0
-
diff --git a/postfix_wizard/scripts/compute_masquerade.sh b/postfix_wizard/scripts/compute_masquerade.sh
deleted file mode 100755
index a6f37111..00000000
--- a/postfix_wizard/scripts/compute_masquerade.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard postfix configuration
-#
-# echo on stdout the correct value of wiz_mail_masquerade
-# (strip @)
-
-
-#stripping @
-
-test=`echo ${wiz_mail_masquerade} |sed -e '/@/{s/^[^@]*@\([^@]*\)$/\1/;}' -e 's! .*$!!'`
-echo_debug "masquerade domain : ${test}"
-
-echo ${test}
-
-# all seems to be ok
-exit 0
-
diff --git a/postfix_wizard/scripts/main.cf.dist.default b/postfix_wizard/scripts/main.cf.dist.default
deleted file mode 100644
index 1267ba64..00000000
--- a/postfix_wizard/scripts/main.cf.dist.default
+++ /dev/null
@@ -1,640 +0,0 @@
-# Global Postfix configuration file. This file lists only a subset
-# of all 300+ parameters. See the postconf(5) manual page for a
-# complete list.
-#
-# The general format of each line is: parameter = value. Lines
-# that begin with whitespace continue the previous line. A value can
-# contain references to other $names or ${name}s.
-#
-# NOTE - CHANGE NO MORE THAN 2-3 PARAMETERS AT A TIME, AND TEST IF
-# POSTFIX STILL WORKS AFTER EVERY CHANGE.
-
-# SOFT BOUNCE
-#
-# The soft_bounce parameter provides a limited safety net for
-# testing. When soft_bounce is enabled, mail will remain queued that
-# would otherwise bounce. This parameter disables locally-generated
-# bounces, and prevents the SMTP server from rejecting mail permanently
-# (by changing 5xx replies into 4xx replies). However, soft_bounce
-# is no cure for address rewriting mistakes or mail routing mistakes.
-#
-#soft_bounce = no
-
-# LOCAL PATHNAME INFORMATION
-#
-# The queue_directory specifies the location of the Postfix queue.
-# This is also the root directory of Postfix daemons that run chrooted.
-# See the files in examples/chroot-setup for setting up Postfix chroot
-# environments on different UNIX systems.
-#
-queue_directory = /var/spool/postfix
-
-# The command_directory parameter specifies the location of all
-# postXXX commands.
-#
-command_directory = /usr/sbin
-
-# The daemon_directory parameter specifies the location of all Postfix
-# daemon programs (i.e. programs listed in the master.cf file). This
-# directory must be owned by root.
-#
-daemon_directory = /usr/lib/postfix
-
-# QUEUE AND PROCESS OWNERSHIP
-#
-# The mail_owner parameter specifies the owner of the Postfix queue
-# and of most Postfix daemon processes. Specify the name of a user
-# account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
-# AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
-# particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
-# USER.
-#
-mail_owner = postfix
-
-# The default_privs parameter specifies the default rights used by
-# the local delivery agent for delivery to external file or command.
-# These rights are used in the absence of a recipient user context.
-# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
-#
-#default_privs = nobody
-
-# INTERNET HOST AND DOMAIN NAMES
-#
-# The myhostname parameter specifies the internet hostname of this
-# mail system. The default is to use the fully-qualified domain name
-# from gethostname(). $myhostname is used as a default value for many
-# other configuration parameters.
-#
-#myhostname = host.domain.tld
-#myhostname = virtual.domain.tld
-
-# The mydomain parameter specifies the local internet domain name.
-# The default is to use $myhostname minus the first component.
-# $mydomain is used as a default value for many other configuration
-# parameters.
-#
-#mydomain = domain.tld
-
-# SENDING MAIL
-#
-# The myorigin parameter specifies the domain that locally-posted
-# mail appears to come from. The default is to append $myhostname,
-# which is fine for small sites. If you run a domain with multiple
-# machines, you should (1) change this to $mydomain and (2) set up
-# a domain-wide alias database that aliases each user to
-# user@that.users.mailhost.
-#
-# For the sake of consistency between sender and recipient addresses,
-# myorigin also specifies the default domain name that is appended
-# to recipient addresses that have no @domain part.
-#
-#myorigin = $myhostname
-#myorigin = $mydomain
-
-# RECEIVING MAIL
-
-# The inet_interfaces parameter specifies the network interface
-# addresses that this mail system receives mail on. By default,
-# the software claims all active interfaces on the machine. The
-# parameter also controls delivery of mail to user@[ip.address].
-#
-# See also the proxy_interfaces parameter, for network addresses that
-# are forwarded to us via a proxy or network address translator.
-#
-# Note: you need to stop/start Postfix when this parameter changes.
-#
-inet_interfaces = localhost
-#inet_interfaces = all
-#inet_interfaces = $myhostname
-#inet_interfaces = $myhostname, localhost
-
-# The proxy_interfaces parameter specifies the network interface
-# addresses that this mail system receives mail on by way of a
-# proxy or network address translation unit. This setting extends
-# the address list specified with the inet_interfaces parameter.
-#
-# You must specify your proxy/NAT addresses when your system is a
-# backup MX host for other domains, otherwise mail delivery loops
-# will happen when the primary MX host is down.
-#
-#proxy_interfaces =
-#proxy_interfaces = 1.2.3.4
-
-# The mydestination parameter specifies the list of domains that this
-# machine considers itself the final destination for.
-#
-# These domains are routed to the delivery agent specified with the
-# local_transport parameter setting. By default, that is the UNIX
-# compatible delivery agent that lookups all recipients in /etc/passwd
-# and /etc/aliases or their equivalent.
-#
-# The default is $myhostname + localhost.$mydomain. On a mail domain
-# gateway, you should also include $mydomain.
-#
-# Do not specify the names of virtual domains - those domains are
-# specified elsewhere (see VIRTUAL_README).
-#
-# Do not specify the names of domains that this machine is backup MX
-# host for. Specify those names via the relay_domains settings for
-# the SMTP server, or use permit_mx_backup if you are lazy (see
-# STANDARD_CONFIGURATION_README).
-#
-# The local machine is always the final destination for mail addressed
-# to user@[the.net.work.address] of an interface that the mail system
-# receives mail on (see the inet_interfaces parameter).
-#
-# Specify a list of host or domain names, /file/name or type:table
-# patterns, separated by commas and/or whitespace. A /file/name
-# pattern is replaced by its contents; a type:table is matched when
-# a name matches a lookup key (the right-hand side is ignored).
-# Continue long lines by starting the next line with whitespace.
-#
-# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
-#
-mydestination = $myhostname, localhost.$mydomain, localhost
-#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
-#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
-# mail.$mydomain, www.$mydomain, ftp.$mydomain
-
-# REJECTING MAIL FOR UNKNOWN LOCAL USERS
-#
-# The local_recipient_maps parameter specifies optional lookup tables
-# with all names or addresses of users that are local with respect
-# to $mydestination, $inet_interfaces or $proxy_interfaces.
-#
-# If this parameter is defined, then the SMTP server will reject
-# mail for unknown local users. This parameter is defined by default.
-#
-# To turn off local recipient checking in the SMTP server, specify
-# local_recipient_maps = (i.e. empty).
-#
-# The default setting assumes that you use the default Postfix local
-# delivery agent for local delivery. You need to update the
-# local_recipient_maps setting if:
-#
-# - You define $mydestination domain recipients in files other than
-# /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
-# For example, you define $mydestination domain recipients in
-# the $virtual_mailbox_maps files.
-#
-# - You redefine the local delivery agent in master.cf.
-#
-# - You redefine the "local_transport" setting in main.cf.
-#
-# - You use the "luser_relay", "mailbox_transport", or "fallback_transport"
-# feature of the Postfix local delivery agent (see local(8)).
-#
-# Details are described in the LOCAL_RECIPIENT_README file.
-#
-# Beware: if the Postfix SMTP server runs chrooted, you probably have
-# to access the passwd file via the proxymap service, in order to
-# overcome chroot restrictions. The alternative, having a copy of
-# the system passwd file in the chroot jail is just not practical.
-#
-# The right-hand side of the lookup tables is conveniently ignored.
-# In the left-hand side, specify a bare username, an @domain.tld
-# wild-card, or specify a user@domain.tld address.
-#
-#local_recipient_maps = unix:passwd.byname $alias_maps
-#local_recipient_maps = proxy:unix:passwd.byname $alias_maps
-#local_recipient_maps =
-
-# The unknown_local_recipient_reject_code specifies the SMTP server
-# response code when a recipient domain matches $mydestination or
-# ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty
-# and the recipient address or address local-part is not found.
-#
-# The default setting is 550 (reject mail) but it is safer to start
-# with 450 (try again later) until you are certain that your
-# local_recipient_maps settings are OK.
-#
-unknown_local_recipient_reject_code = 550
-
-# TRUST AND RELAY CONTROL
-
-# The mynetworks parameter specifies the list of "trusted" SMTP
-# clients that have more privileges than "strangers".
-#
-# In particular, "trusted" SMTP clients are allowed to relay mail
-# through Postfix. See the smtpd_recipient_restrictions parameter
-# in postconf(5).
-#
-# You can specify the list of "trusted" network addresses by hand
-# or you can let Postfix do it for you (which is the default).
-#
-# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
-# clients in the same IP subnetworks as the local machine.
-# On Linux, this does works correctly only with interfaces specified
-# with the "ifconfig" command.
-#
-# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
-# clients in the same IP class A/B/C networks as the local machine.
-# Don't do this with a dialup site - it would cause Postfix to "trust"
-# your entire provider's network. Instead, specify an explicit
-# mynetworks list by hand, as described below.
-#
-# Specify "mynetworks_style = host" when Postfix should "trust"
-# only the local machine.
-#
-#mynetworks_style = class
-#mynetworks_style = subnet
-mynetworks_style = host
-
-# Alternatively, you can specify the mynetworks list by hand, in
-# which case Postfix ignores the mynetworks_style setting.
-#
-# Specify an explicit list of network/netmask patterns, where the
-# mask specifies the number of bits in the network part of a host
-# address.
-#
-# You can also specify the absolute pathname of a pattern file instead
-# of listing the patterns here. Specify type:table for table-based lookups
-# (the value on the table right-hand side is not used).
-#
-#mynetworks = 168.100.189.0/28, 127.0.0.0/8
-#mynetworks = $config_directory/mynetworks
-#mynetworks = hash:/etc/postfix/network_table
-
-# The relay_domains parameter restricts what destinations this system will
-# relay mail to. See the smtpd_recipient_restrictions description in
-# postconf(5) for detailed information.
-#
-# By default, Postfix relays mail
-# - from "trusted" clients (IP address matches $mynetworks) to any destination,
-# - from "untrusted" clients to destinations that match $relay_domains or
-# subdomains thereof, except addresses with sender-specified routing.
-# The default relay_domains value is $mydestination.
-#
-# In addition to the above, the Postfix SMTP server by default accepts mail
-# that Postfix is final destination for:
-# - destinations that match $inet_interfaces or $proxy_interfaces,
-# - destinations that match $mydestination
-# - destinations that match $virtual_alias_domains,
-# - destinations that match $virtual_mailbox_domains.
-# These destinations do not need to be listed in $relay_domains.
-#
-# Specify a list of hosts or domains, /file/name patterns or type:name
-# lookup tables, separated by commas and/or whitespace. Continue
-# long lines by starting the next line with whitespace. A file name
-# is replaced by its contents; a type:name table is matched when a
-# (parent) domain appears as lookup key.
-#
-# NOTE: Postfix will not automatically forward mail for domains that
-# list this system as their primary or backup MX host. See the
-# permit_mx_backup restriction description in postconf(5).
-#
-#relay_domains = $mydestination
-
-# INTERNET OR INTRANET
-
-# The relayhost parameter specifies the default host to send mail to
-# when no entry is matched in the optional transport(5) table. When
-# no relayhost is given, mail is routed directly to the destination.
-#
-# On an intranet, specify the organizational domain name. If your
-# internal DNS uses no MX records, specify the name of the intranet
-# gateway host instead.
-#
-# In the case of SMTP, specify a domain, host, host:port, [host]:port,
-# [address] or [address]:port; the form [host] turns off MX lookups.
-#
-# If you're connected via UUCP, see also the default_transport parameter.
-#
-#relayhost = $mydomain
-#relayhost = [gateway.my.domain]
-#relayhost = [mailserver.isp.tld]
-#relayhost = uucphost
-#relayhost = [an.ip.add.ress]
-
-# REJECTING UNKNOWN RELAY USERS
-#
-# The relay_recipient_maps parameter specifies optional lookup tables
-# with all addresses in the domains that match $relay_domains.
-#
-# If this parameter is defined, then the SMTP server will reject
-# mail for unknown relay users. This feature is off by default.
-#
-# The right-hand side of the lookup tables is conveniently ignored.
-# In the left-hand side, specify an @domain.tld wild-card, or specify
-# a user@domain.tld address.
-#
-#relay_recipient_maps = hash:/etc/postfix/relay_recipients
-
-# INPUT RATE CONTROL
-#
-# The in_flow_delay configuration parameter implements mail input
-# flow control. This feature is turned on by default, although it
-# still needs further development (it's disabled on SCO UNIX due
-# to an SCO bug).
-#
-# A Postfix process will pause for $in_flow_delay seconds before
-# accepting a new message, when the message arrival rate exceeds the
-# message delivery rate. With the default 100 SMTP server process
-# limit, this limits the mail inflow to 100 messages a second more
-# than the number of messages delivered per second.
-#
-# Specify 0 to disable the feature. Valid delays are 0..10.
-#
-#in_flow_delay = 1s
-
-# ADDRESS REWRITING
-#
-# The ADDRESS_REWRITING_README document gives information about
-# address masquerading or other forms of address rewriting including
-# username->Firstname.Lastname mapping.
-
-# ADDRESS REDIRECTION (VIRTUAL DOMAIN)
-#
-# The VIRTUAL_README document gives information about the many forms
-# of domain hosting that Postfix supports.
-
-# "USER HAS MOVED" BOUNCE MESSAGES
-#
-# See the discussion in the ADDRESS_REWRITING_README document.
-
-# TRANSPORT MAP
-#
-# See the discussion in the ADDRESS_REWRITING_README document.
-
-# ALIAS DATABASE
-#
-# The alias_maps parameter specifies the list of alias databases used
-# by the local delivery agent. The default list is system dependent.
-#
-# On systems with NIS, the default is to search the local alias
-# database, then the NIS alias database. See aliases(5) for syntax
-# details.
-#
-# If you change the alias database, run "postalias /etc/aliases" (or
-# wherever your system stores the mail alias file), or simply run
-# "newaliases" to build the necessary DBM or DB file.
-#
-# It will take a minute or so before changes become visible. Use
-# "postfix reload" to eliminate the delay.
-#
-#alias_maps = dbm:/etc/aliases
-alias_maps = hash:/etc/aliases
-#alias_maps = hash:/etc/aliases, nis:mail.aliases
-#alias_maps = netinfo:/aliases
-
-# The alias_database parameter specifies the alias database(s) that
-# are built with "newaliases" or "sendmail -bi". This is a separate
-# configuration parameter, because alias_maps (see above) may specify
-# tables that are not necessarily all under control by Postfix.
-#
-#alias_database = dbm:/etc/aliases
-#alias_database = dbm:/etc/mail/aliases
-#alias_database = hash:/etc/aliases
-#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
-
-# ADDRESS EXTENSIONS (e.g., user+foo)
-#
-# The recipient_delimiter parameter specifies the separator between
-# user names and address extensions (user+foo). See canonical(5),
-# local(8), relocated(5) and virtual(5) for the effects this has on
-# aliases, canonical, virtual, relocated and .forward file lookups.
-# Basically, the software tries user+foo and .forward+foo before
-# trying user and .forward.
-#
-#recipient_delimiter = +
-
-# DELIVERY TO MAILBOX
-#
-# The home_mailbox parameter specifies the optional pathname of a
-# mailbox file relative to a user's home directory. The default
-# mailbox file is /var/spool/mail/user or /var/mail/user. Specify
-# "Maildir/" for qmail-style delivery (the / is required).
-#
-#home_mailbox = Mailbox
-#home_mailbox = Maildir/
-
-# The mail_spool_directory parameter specifies the directory where
-# UNIX-style mailboxes are kept. The default setting depends on the
-# system type.
-#
-#mail_spool_directory = /var/mail
-#mail_spool_directory = /var/spool/mail
-
-# The mailbox_command parameter specifies the optional external
-# command to use instead of mailbox delivery. The command is run as
-# the recipient with proper HOME, SHELL and LOGNAME environment settings.
-# Exception: delivery for root is done as $default_user.
-#
-# Other environment variables of interest: USER (recipient username),
-# EXTENSION (address extension), DOMAIN (domain part of address),
-# and LOCAL (the address localpart).
-#
-# Unlike other Postfix configuration parameters, the mailbox_command
-# parameter is not subjected to $parameter substitutions. This is to
-# make it easier to specify shell syntax (see example below).
-#
-# Avoid shell meta characters because they will force Postfix to run
-# an expensive shell process. Procmail alone is expensive enough.
-#
-# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
-# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
-#
-#mailbox_command = /some/where/procmail
-#mailbox_command = /some/where/procmail -a "$EXTENSION"
-
-# The mailbox_transport specifies the optional transport in master.cf
-# to use after processing aliases and .forward files. This parameter
-# has precedence over the mailbox_command, fallback_transport and
-# luser_relay parameters.
-#
-# Specify a string of the form transport:nexthop, where transport is
-# the name of a mail delivery transport defined in master.cf. The
-# :nexthop part is optional. For more details see the sample transport
-# configuration file.
-#
-# NOTE: if you use this feature for accounts not in the UNIX password
-# file, then you must update the "local_recipient_maps" setting in
-# the main.cf file, otherwise the SMTP server will reject mail for
-# non-UNIX accounts with "User unknown in local recipient table".
-#
-#mailbox_transport = lmtp:unix:/file/name
-#mailbox_transport = cyrus
-
-# The fallback_transport specifies the optional transport in master.cf
-# to use for recipients that are not found in the UNIX passwd database.
-# This parameter has precedence over the luser_relay parameter.
-#
-# Specify a string of the form transport:nexthop, where transport is
-# the name of a mail delivery transport defined in master.cf. The
-# :nexthop part is optional. For more details see the sample transport
-# configuration file.
-#
-# NOTE: if you use this feature for accounts not in the UNIX password
-# file, then you must update the "local_recipient_maps" setting in
-# the main.cf file, otherwise the SMTP server will reject mail for
-# non-UNIX accounts with "User unknown in local recipient table".
-#
-#fallback_transport = lmtp:unix:/file/name
-#fallback_transport = cyrus
-#fallback_transport =
-
-# The luser_relay parameter specifies an optional destination address
-# for unknown recipients. By default, mail for unknown@$mydestination,
-# unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned
-# as undeliverable.
-#
-# The following expansions are done on luser_relay: $user (recipient
-# username), $shell (recipient shell), $home (recipient home directory),
-# $recipient (full recipient address), $extension (recipient address
-# extension), $domain (recipient domain), $local (entire recipient
-# localpart), $recipient_delimiter. Specify ${name?value} or
-# ${name:value} to expand value only when $name does (does not) exist.
-#
-# luser_relay works only for the default Postfix local delivery agent.
-#
-# NOTE: if you use this feature for accounts not in the UNIX password
-# file, then you must specify "local_recipient_maps =" (i.e. empty) in
-# the main.cf file, otherwise the SMTP server will reject mail for
-# non-UNIX accounts with "User unknown in local recipient table".
-#
-#luser_relay = $user@other.host
-#luser_relay = $local@other.host
-#luser_relay = admin+$local
-
-# JUNK MAIL CONTROLS
-#
-# The controls listed here are only a very small subset. The file
-# SMTPD_ACCESS_README provides an overview.
-
-# The header_checks parameter specifies an optional table with patterns
-# that each logical message header is matched against, including
-# headers that span multiple physical lines.
-#
-# By default, these patterns also apply to MIME headers and to the
-# headers of attached messages. With older Postfix versions, MIME and
-# attached message headers were treated as body text.
-#
-# For details, see "man header_checks".
-#
-#header_checks = regexp:/etc/postfix/header_checks
-
-# FAST ETRN SERVICE
-#
-# Postfix maintains per-destination logfiles with information about
-# deferred mail, so that mail can be flushed quickly with the SMTP
-# "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
-# See the ETRN_README document for a detailed description.
-#
-# The fast_flush_domains parameter controls what destinations are
-# eligible for this service. By default, they are all domains that
-# this server is willing to relay mail to.
-#
-#fast_flush_domains = $relay_domains
-
-# SHOW SOFTWARE VERSION OR NOT
-#
-# The smtpd_banner parameter specifies the text that follows the 220
-# code in the SMTP server's greeting banner. Some people like to see
-# the mail version advertised. By default, Postfix shows no version.
-#
-# You MUST specify $myhostname at the start of the text. That is an
-# RFC requirement. Postfix itself does not care.
-#
-#smtpd_banner = $myhostname ESMTP $mail_name
-#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
-smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrakelinux)
-
-# PARALLEL DELIVERY TO THE SAME DESTINATION
-#
-# How many parallel deliveries to the same user or domain? With local
-# delivery, it does not make sense to do massively parallel delivery
-# to the same user, because mailbox updates must happen sequentially,
-# and expensive pipelines in .forward files can cause disasters when
-# too many are run at the same time. With SMTP deliveries, 10
-# simultaneous connections to the same domain could be sufficient to
-# raise eyebrows.
-#
-# Each message delivery transport has its XXX_destination_concurrency_limit
-# parameter. The default is $default_destination_concurrency_limit for
-# most delivery transports. For the local delivery agent the default is 2.
-
-#local_destination_concurrency_limit = 2
-#default_destination_concurrency_limit = 20
-
-# DEBUGGING CONTROL
-#
-# The debug_peer_level parameter specifies the increment in verbose
-# logging level when an SMTP client or server host name or address
-# matches a pattern in the debug_peer_list parameter.
-#
-debug_peer_level = 2
-
-# The debug_peer_list parameter specifies an optional list of domain
-# or network patterns, /file/name patterns or type:name tables. When
-# an SMTP client or server host name or address matches a pattern,
-# increase the verbose logging level by the amount specified in the
-# debug_peer_level parameter.
-#
-#debug_peer_list = 127.0.0.1
-#debug_peer_list = some.domain
-
-# The debugger_command specifies the external command that is executed
-# when a Postfix daemon program is run with the -D option.
-#
-# Use "command .. & sleep 5" so that the debugger can attach before
-# the process marches on. If you use an X-based debugger, be sure to
-# set up your XAUTHORITY environment variable before starting Postfix.
-#
-debugger_command =
- PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
- xxgdb $daemon_directory/$process_name $process_id & sleep 5
-
-# If you don't have X installed on the Postfix machine, try:
-# debugger_command =
-# PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
-# echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
-# >$config_directory/$process_name.$process_id.log & sleep 5
-
-# OTHER OPTIONS (Mandrakelinux)
-# The delay_warning_time specifies after how many hours a warning
-# is sent that mail has not yet been delivered. By default, no warning
-# is sent.
-#
-delay_warning_time = 4
-
-# INSTALL-TIME CONFIGURATION INFORMATION
-#
-# The following parameters are used when installing a new Postfix version.
-#
-# sendmail_path: The full pathname of the Postfix sendmail command.
-# This is the Sendmail-compatible mail posting interface.
-#
-sendmail_path = /usr/sbin/sendmail.postfix
-
-# newaliases_path: The full pathname of the Postfix newaliases command.
-# This is the Sendmail-compatible command to build alias databases.
-#
-newaliases_path = /usr/bin/newaliases.postfix
-
-# mailq_path: The full pathname of the Postfix mailq command. This
-# is the Sendmail-compatible mail queue listing command.
-#
-mailq_path = /usr/bin/mailq.postfix
-
-# setgid_group: The group for mail submission and queue management
-# commands. This must be a group name with a numerical group ID that
-# is not shared with other accounts, not even with the Postfix account.
-#
-setgid_group = postdrop
-
-# html_directory: The location of the Postfix HTML documentation.
-#
-html_directory = /usr/share/doc/postfix-2.1.5/html
-
-# manpage_directory: The location of the Postfix on-line manual pages.
-#
-manpage_directory = /usr/share/man
-
-# sample_directory: The location of the Postfix sample configuration files.
-# This parameter is obsolete as of Postfix 2.1.
-#
-sample_directory = /usr/share/doc/postfix-2.1.5/samples
-
-# readme_directory: The location of the Postfix README files.
-#
-readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES
diff --git a/postfix_wizard/scripts/postfix_do_it.sh b/postfix_wizard/scripts/postfix_do_it.sh
deleted file mode 100755
index 1fbaffd9..00000000
--- a/postfix_wizard/scripts/postfix_do_it.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard network configuration
-#
-# install default postfix configuration for server
-# assuming all dependencies are ok
-
-
-echo_debug "now applying configuration for postfix"
-
-[ -d /etc/postfix ] || exit 1
-
-# first loading values
-. /etc/sysconfig/network
-
-# loading values from /etc/sysconfig/mdk_serv
-# wiz_host_name and wiz_domain_name
-wiz_host_name=`get_var wiz_host_name`
-wiz_domain_name=`get_var wiz_domain_name`
-
-wiz_device=`get_var wiz_device`
-
-
-file="/etc/sysconfig/network-scripts/ifcfg-${wiz_device}"
-echo_debug "device config : ${file}"
-[ -f ${file} ] || exit 1
-. ${file}
-
-# store the wiz_mail variable
-cfg_file=/etc/sysconfig/mdk_serv
-echo_debug "wiz_mail_masquerade ${wiz_mail_masquerade}"
-chg_val ${cfg_file} wiz_ext_mail_relay "${wiz_ext_mail_relay}" s
-chg_val ${cfg_file} wiz_mail_masquerade "${wiz_mail_masquerade}" s
-
-bck_file /etc/postfix/aliases
-bck_file /etc/postfix/canonical
-bck_file /etc/postfix/main.cf
-bck_file /etc/postfix/master.cf
-bck_file /etc/postfix/virtual
-
-# now configuring
-
-postconf -e "myhostname = ${wiz_host_name}"
-postconf -e 'myorigin = $mydomain'
-postconf -e 'inet_interfaces = all'
-postconf -e 'mydestination = $myhostname, localhost.$mydomain, $mydomain'
-
-if [ -n "${wiz_ext_mail_relay}" ]; then
- postconf -e "relayhost = ${wiz_ext_mail_relay}"
-fi
-
-postconf -e 'masquerade_domains = $mydomain'
-
-postconf -e 'alias_maps = hash:/etc/postfix/aliases'
-postconf -e 'alias_database = hash:/etc/postfix/aliases'
-
-postconf -e 'virtual_maps = hash:/etc/postfix/virtual'
-postconf -e 'canonical_maps = hash:/etc/postfix/canonical'
-
-if [ -n "${wiz_mail_masquerade}" ]; then
- if [ ! `grep "@${wiz_domain_name} @${wiz_mail_masquerade}" /etc/postfix/canonical` ]; then
- echo "@${wiz_domain_name} @${wiz_mail_masquerade}" >> /etc/postfix/canonical
- fi
-fi
-
-echo_debug "rebuilding hash"
-
-postmap /etc/postfix/canonical
-postmap /etc/postfix/virtual
-postalias /etc/postfix/aliases
-
-postfix check
-
-echo_debug "end of postfix configuration, restarting"
-
-service postfix restart
-service xinetd restart
-
-# all is ok
-exit 10
diff --git a/postfix_wizard/scripts/testlabel.pl b/postfix_wizard/scripts/testlabel.pl
deleted file mode 100644
index c61d3cb0..00000000
--- a/postfix_wizard/scripts/testlabel.pl
+++ /dev/null
@@ -1,15 +0,0 @@
-$toto = "tutu";
-$tata = "titi";
-
-$file = "/home/logarno/toto";
-open(CANONICAL, "< $file");
-while (<CANONICAL>) {
- if (/\@$toto\s*\@$tata/){
- goto NOUPDATE;
- }
-}
-close(CANONICAL);
-open(CANONICAL, ">> $file");
-print CANONICAL "\n\@$toto \@$tata";
- NOUPDATE:
- close(CANONICAL);
diff --git a/samba_wizard/.perl_checker b/samba_wizard/.perl_checker
deleted file mode 100644
index 0f955156..00000000
--- a/samba_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Net::Ping \ No newline at end of file
diff --git a/samba_wizard/Makefile b/samba_wizard/Makefile
deleted file mode 100644
index 661dadfa..00000000
--- a/samba_wizard/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/samba_wizard
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/samba_wizard/scripts
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/samba_wizard/images
- install --mode=u=rw,g=r,o=r -p samba.wiz ${prefix}/share/wizards/samba_wizard
- cp -avf ./images/*.png ${prefix}/share/wizards/samba_wizard/images/
- install --mode=u=rw,g=r,o=r -p scripts/Smbconf.pm ${prefix}/share/wizards/samba_wizard/scripts
- install --mode=u=rw,g=r,o=r -p scripts/smb.conf.default ${prefix}/share/wizards/samba_wizard/scripts
diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm
deleted file mode 100755
index d845812d..00000000
--- a/samba_wizard/Samba.pm
+++ /dev/null
@@ -1,490 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-# Copyright (C) 2002,2005 Mandriva
-#
-# Authors: Arnaud Desmons <adesmons@mandrakesoft.com>
-# Florent Villard <warly@mandrakesoft.com>
-# antoine Ginies <aginies@mandriva>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Samba;
-use strict;
-
-use common;
-use services;
-use MDK::Wizard::Wizcommon;
-use Gtk2;
-
-use Libconf::Templates;
-use Libconf::Glueconf::Samba::Smb_conf;
-
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-
-my $DOMAINNAME = chomp_(`dnsdomainname`);
-my $SHORTHOSTNAME = chomp_(`hostname -s`);
-my $wiz_samba_etc = "/etc/sysconfig/wizard_samba";
-my @listshare;
-my @listprinters;
-
-my $o = {
- name => 'Samba wizard',
- var => {
- wiz_box_list => '',
- wiz_netbios => '',
- wiz_all_printers => '',
- wiz_level => '',
- wiz_workgroup => '',
- wiz_banner => '',
- wiz_log_file => '', wiz_log_level => '', wiz_max_log_size => '',
- wiz_local_master => '',
- wiz_os_level => '',
- wiz_security => '',
- wiz_domain_logons => '',
- wiz_domain_master => '',
- wiz_password_server => '',
- wiz_passdb_backend => '', wiz_passdb_backend_yn => '',
- wiz_ldap_admin_dn => '', wiz_ldap_suffix => '', wiz_ldap_root_pw => '', wiz_ldap_root_pw_2 => '',
- wiz_preferred_master => '',
- wiz_wins_server => '',
- wiz_name_resolve_order => '',
- wiz_dns_proxy => '',
- wiz_sambatype => '',
- },
- init => sub {
- my ($err, $msg) = test_host_domain($SHORTHOSTNAME, $DOMAINNAME);
- if (!$err) {
- $in->ask_warn(N('Error'), $msg);
- die 'wizcancel';
- }
- },
- needed_rpm => [ 'samba-server' ],
- defaultimage => "/usr/share/wizards/samba_wizard/images/sambasrv.png",
- };
-
-# we ask glueconf to give us the structure representing /etc/samba/smb.conf
-if (!-f "/etc/samba/smb.conf") { mkdir_p("/etc/samba/"); cp_af("/usr/share/wizards/samba_wizard/scripts/smb.conf.default", "/etc/samba/smb.conf") }
-my $samba = new Libconf::Glueconf::Samba::Smb_conf({ filename => '/etc/samba/smb.conf' });
-#my $samba = new Libconf::Glueconf::Samba::Smb_conf(filename => '/etc/samba/smb.conf', comments_struct => [['^\s*#'], ['^\s*;']]);
-$samba->{libconf}{disable_inline_comments} = 1;
-
-#debug
-use Data::Dumper;
-print Dumper($samba);
-
-my %type = (
- 1 => N("BDC - backup domain controller (need PDC+LDAP)"),
- 2 => N("PDC - primary domain controller"),
- 3 => N("Standalone - standalone server"),
- # 4 => N("Member - member of a domain"),
- );
-
-my @yesorno = qw(yes no); push @yesorno, "";
-my @loglevel = qw(0 1 2 3 4 5 6 7 8 9);
-
-$o->{pages} = {
- welcome => {
- name => N("Samba server configuration Wizard") . "\n\n" . N("Samba allows your server to behave as a file and print server for workstations running non-Linux systems."),
- no_back => 1,
- pre => sub {
- if (-f $wiz_samba_etc) {
-# $::isWizard = 1;
-# $in->ask_warn(N("Information"), N("It seems you previously setup a Samba server. This wizard will re-read your old configuration, and show you the Samba server type you choose")) and return 0;
- my $data = cat_($wiz_samba_etc);
- # detect old Samba type
- my ($old_type) = $data =~ /type=(\d)/;
- $o->{var}{wiz_type} = chomp_($old_type);
- } else { $o->{var}{wiz_type} = 3 }
- },
- post => sub {
- if ($o->{var}{wiz_type} == 2) {
- return 'pdc' }
- elsif ($o->{var}{wiz_type} == 1) {
- return 'bdc' }
- elsif ($o->{var}{wiz_type} == 3) {
- return 'ask_workgroup' }
- elsif ($o->{var}{wiz_type} == 4) {
- return 'member' }
- },
- data => [
- { label => "", val => \$o->{var}{wiz_type}, type => 'list', list => [ sort keys %type ], format => sub { $type{$_[0]} } },
- ],
- },
- pdc => {
- name => N("PDC server: primary domain controller") . "\n\n" . N("Server configured as a PDC is responsible for Windows authentication throughout the domain.") . "\n" . N("Single server installations may use smbpasswd or tdbsam password backends") . "\n" . N("Domain master = yes, causes the server to register the NetBIOS name <pdc name>1B. This name will be recognized by other servers."),
- pre => sub {
- $o->{var}{wiz_domain_master} = "yes";
- $o->{var}{wiz_security} = "user";
- $o->{var}{wiz_domain_logons} = "yes";
- $o->{var}{wiz_wins_support} ||= $samba->{global}{'wins support'};
- $o->{var}{wiz_oslevel} = "128";
-
- if (exists $samba->{global}{'passdb backend'}) {
- $o->{var}{wiz_passdb_backend_yn} = "yes";
- }
- else {
- $o->{var}{wiz_passdb_backend_yn} = "no";
- }
- },
- next => 'ask_workgroup',
-# post => sub {
-# $o->{var}{wiz_passdb_backend_yn} =~ /yes/ and return 'ldap_conf';
-# },
- data => [
- { label => N("Domain logons:"), val_ref => \$o->{var}{wiz_domain_logons} },
- { label => N("Domain master:"), val_ref => \$o->{var}{wiz_domain_master} },
- { label => N("Security:"), val_ref => \$o->{var}{wiz_security} },
- { label => N("Wins support:"), val => \$o->{var}{wiz_wins_support}, fixed_list => \@yesorno },
- { label => N("admin users:"), val => \$o->{var}{wiz_admin_users}, help => N("root \@adm") },
- { label => N("Os level:"), val_ref => \$o->{var}{wiz_oslevel}, help => N("The global os level option dictates the operating system level at which Samba will masquerade during a browser election. If you wish to have Samba win an election and become the master browser, you can set the level above that of the operating system on your network with the highest current value. ie: os level = 34") },
-# { label => N("Use LDAP Passdb backend"), val => \$o->{var}{wiz_passdb_backend_yn}, fixed_list => \@yesorno },
- ],
- complete => sub {
- if (!$o->{var}{wiz_domain_master}) {
- $in->ask_warn(N("Error"), N("The domain is wrong."));
- return 1;
- } else { return 0 }
- },
- next => 'ask_workgroup',
- },
- bdc => {
- name => N("BDC server: backup domain controller") . "\n\n" . N("This enables BDCs to carry much of the network logon processing. A BDC on a local segment handles logon requests and authenticates users when the PDC is busy on the local network. When a segment becomes heavily loaded, the reponsibility is offloaded to another segment's BDC or to the PDC."),
- pre => sub {
- $o->{var}{wiz_domain_master} = "no";
- $o->{var}{wiz_security} = "user";
- $o->{var}{wiz_wins_support} = "";
- $o->{var}{wiz_oslevel} = "70";
- $o->{var}{wiz_local_master} = "yes";
- $o->{var}{wiz_domain_master} = "no";
- $o->{var}{wiz_preferred_master} = "yes";
- $o->{var}{wiz_domain_logons} = "yes";
- $o->{var}{wiz_wins_server} = "";
- if ($samba->{global}{'name resolve order'}) {
- $o->{var}{wiz_name_resolve_order} = $samba->{global}{'name resolve order'};
- } else { $o->{var}{wiz_name_resolve_order} = "lmhosts host wins bcast" }
- $o->{var}{wiz_dns_proxy} = "no";
- },
- data => [
- { label => N("Wins support:"), val => \$o->{var}{wiz_wins_support}, fixed_list => \@yesorno },
- { label => N("Wins server:"), val => \$o->{var}{wiz_wins_server}, help => N("This specifies the IP address (or DNS name: IP address for preference) of the WINS server that nmbd(8) should register with. If you have a WINS server on your network then you should set this to the WINS server's IP.") },
- { label => N("Wins name resolve order:"), val => \$o->{var}{wiz_name_resolve_order} },
- ],
- complete => sub {
- if ($o->{var}{wiz_wins_support} =~ /no/ and !$o->{var}{wiz_wins_server}) {
- $in->ask_warn(N("Error"), N("Your server doesn't support Wins. Please provide a Wins server, or leave blank Wins Support entry."));
- return 1;
- } else { return 0 }
- },
- next => 'ask_bdc2',
- },
- ask_bdc2 => {
- name => N("BDC server: needed fixed options"),
- data => [
- { label => N("Domain master:"), val_ref => \$o->{var}{wiz_domain_master} },
- { label => N("Security:"), val_ref => \$o->{var}{wiz_security} },
- { label => N("Os level:"), val_ref => \$o->{var}{wiz_oslevel} },
- { label => N("Local master:"), val_ref => \$o->{var}{wiz_local_master} },
- { label => N("Domain master"), val_ref => \$o->{var}{wiz_domain_master} },
- { label => N("Preferred master"), val_ref => \$o->{var}{wiz_preferred_master} },
- { label => N("Domain logons"), val_ref => \$o->{var}{wiz_domain_logons} },
- { label => N("admin users:"), val => \$o->{var}{wiz_admin_users}, help => N("root \@adm") },
- ],
- next => 'ldap_conf',
- },
- member => {
- name => N("Member of a domain") . "\n\n" . N("Share data, users home or printers.") . "\n" . N("Please enter the domain you want to join."),
- pre => sub {
- $o->{var}{wiz_security} = "domain";
- $o->{var}{wiz_domain_master} = "no";
- $o->{var}{wiz_password_server} ||= $samba->{global}{'password server'};
- if ($samba->{global}{'passdb backend'}) {
- $o->{var}{wiz_passdb_backend_yn} = "yes";
- } else {
- $o->{var}{wiz_passdb_backend_yn} = "no";
- }
- },
- post => sub {
- $o->{var}{wiz_passdb_backend_yn} =~ /yes/ and return 'ldap_conf';
- },
- data => [
- { label => N("Password server"), hidden => 1, val => \$o->{var}{wiz_password_server} },
- { label => N("Use LDAP Passdb backend"), val => \$o->{var}{wiz_passdb_backend_yn}, fixed_list => \@yesorno },
- { label => N("Security:"), val_ref => \$o->{var}{wiz_security} },
- { label => N("Domain master:"), val_ref => \$o->{var}{wiz_domain_master} },
-
- ],
- complete => sub {
- if (!$o->{var}{wiz_password_server}) {
- $in->ask_warn(N("Error"), N("Please provide the password server."));
- return 1;
- } else { return 0 }
- },
- next => 'ask_workgroup',
- },
- ldap_conf => {
- name => N("LDAP configuration for Domain Controlling") . "\n\n" . N("The account (dn) that samba uses to access the LDAP server. This account needs to have write access to the LDAP tree. You will need to give samba the password for this dn."),
- pre => sub {
- $o->{var}{wiz_ldap_passwd_sync} = "yes";
- if ($samba->{global}{'ldap suffix'}) {
- $o->{var}{wiz_ldap_suffix} = $samba->{global}{'ldap suffix'};
- } else { $o->{var}{wiz_ldap_suffix} = "dc=mydomain, dc=com" }
- if ($samba->{global}{'ldap admin dn'}) {
- $o->{var}{wiz_ldap_admin_dn} ||= $samba->{global}{'ldap admin dn'};
- } else { $o->{var}{wiz_ldap_admin_dn} = "cn=Manager,dc=mydomain,dc=com" }
- if ($samba->{global}{'passdb backend'}) {
- $o->{var}{wiz_passdb_backend} = $samba->{global}{'passdb backend'};
- } else { $o->{var}{wiz_passdb_backend} = "ldapsam:ldap://localhost" }
- if ($samba->{global}{'ldap machine suffix'}) {
- $o->{var}{wiz_ldap_machine_suffix} = $samba->{global}{'ldap machine suffix'};
- } else { $o->{var}{wiz_ldap_machine_suffix} = "ou=Computers" }
- if ($samba->{global}{'ldap group suffix'}) {
- $o->{var}{wiz_ldap_group_suffix} = $samba->{global}{'ldap group suffix'};
- } else { $o->{var}{wiz_ldap_group_suffix} = "ou=Groups" }
- if ($samba->{global}{'ldap user suffix'}) {
- $o->{var}{wiz_ldap_user_suffix} = $samba->{global}{'ldap user suffix'};
- } else { $o->{var}{wiz_ldap_user_suffix} = "ou=Users" }
- },
- data => [
- { label => N("Passdb backend"), val => \$o->{var}{wiz_passdb_backend}, help => "ldapsam:ldap://<ldap server name>" },
- { label => N("LDAP administrator"), val => \$o->{var}{wiz_ldap_admin_dn}, help => N(" The ldap admin dn defines the Distinguished Name (DN) name used by Samba to contact the ldap server when retreiving user account information. ie: cn=Manager,dc=mydomain,dc=com") },
- { label => N("LDAP suffix"), val => \$o->{var}{wiz_ldap_suffix}, help => N("Specifies where user and machine accounts are added to the tree. Can be overriden by ldap user suffix and ldap machine suffix. It also used as the base dn for all ldap searches. ie: dc=\$DOMAINNAME,dc=com") },
- { label => N("LDAP password"), hidden => 1, val => \$o->{var}{wiz_ldap_root_pw} },
- { label => N("LDAP password check:"), hidden => 1, val => \$o->{var}{wiz_ldap_root_pw_2} },
- { label => N("LDAP machine suffix:"), val => \$o->{var}{wiz_ldap_machine_suffix}, help => N("It specifies where machines should be added to the ldap tree. ie: ou=Computers") },
- { label => N("LDAP user suffix:"), val => \$o->{var}{wiz_ldap_user_suffix}, help => N("This parameter specifies where users are added to the tree. If this parameter is not specified, the value from ldap suffix will be used.") },
- { label => N("LDAP group suffix:"), val => \$o->{var}{wiz_ldap_group_suffix}, help => N("This parameters specifies the suffix that is used for groups when these are added to the LDAP directory. ie: ou=Groups") },
- ],
- complete => sub {
- if (!($o->{var}{wiz_ldap_suffix})) {
- $in->ask_warn(N("Error"), N("Please provide an LDAP suffix."));
- return 1;
- }
- if (! ($o->{var}{wiz_ldap_admin_dn})) {
- $in->ask_warn(N("Error"), N("Please enter an LDAP administrator."));
- return 1;
- }
- if (! ($o->{var}{wiz_ldap_root_pw})) {
- $in->ask_warn(N("Error"), N("Please enter an LDAP password."));
- return 1;
- }
- if ($o->{var}{wiz_ldap_root_pw} ne $o->{var}{wiz_ldap_root_pw_2}) {
- $in->ask_warn(N("Error"), N("Passwords do not match."));
- return 1;
- }
- },
- next => 'ask_workgroup',
- },
- ask_workgroup => {
- name => N("Workgroup") . "\n\n" . N("Samba needs to know the Windows Workgroup it will serve."),
- pre => sub {
- $o->{var}{wiz_workgroup} ||= $samba->{global}{workgroup};
- $o->{var}{wiz_netbios} ||= $samba->{global}{netbios};
- $o->{var}{wiz_netbios_name} ||= $samba->{global}{"netbios name"};
- },
- data => [
- { label => N("Workgroup:"), val => \$o->{var}{wiz_workgroup} },
- { label => N("Netbios name:"), val => \$o->{var}{wiz_netbios_name} },
- ],
- complete => sub {
- if (!$o->{var}{wiz_workgroup}) {
- $in->ask_warn(N("Error"), N("The Workgroup is wrong."));
- return 1;
- } else { return 0 }
- },
- next => 'ask_banner',
- },
- ask_banner => {
- name => N("Server Banner.") . "\n\n" . N("The banner is the way this server will be described in the Windows workstations."),
- pre => sub {
- $o->{var}{wiz_banner} ||= $samba->{global}{'server string'};
- },
- data => [
- { label => N("Banner:"), val => \$o->{var}{wiz_banner}, help => "Samba Server %v" },
- ],
- complete => sub {
- if (!$o->{var}{wiz_banner}) {
- $in->ask_warn(N("Error"), N("The Server Banner is incorrect."));
- return 1;
- } else { return 0 }
- },
- next => 'ask_log',
- },
- ask_log => {
- name => N("Samba Log") . "\n" . N("Log file: use file.%m to use a separate log file for each machine that connects") . "\n" . N("Log level: set the log (verbosity) level (0 <= log level <= 10)") . "\n" . N("Max Log size: put a capping on the size of the log files (in Kb)."),
- pre => sub {
- $o->{var}{wiz_log_file} ||= $samba->{global}{'log file'};
- $o->{var}{wiz_log_level} ||= $samba->{global}{'log level'};
- $o->{var}{wiz_max_log_size} ||= $samba->{global}{'max log size'};
- },
- data => [
- { label => N("Log file:"), val => \$o->{var}{wiz_log_file}, help => "/var/log/samba/log.%m" },
- { label => N("Max log size:"), val => \$o->{var}{wiz_max_log_size}, help => "50" },
- { label => N("Log level:"), val => \$o->{var}{wiz_log_level}, fixed_list => \@loglevel },
- ],
- next => 'summary',
- },
- summary => {
- name => N("The wizard collected the following parameters to configure Samba.") . "\n\n" . N("To accept these values, and configure your server, click the Next button or use the Back button to correct them.") . "\n" . N("If you have previously create some shares, they will appear in this configuration. Run 'drakwizard sambashare' to manage your shares."),
- pre => sub {
- $o->{var}{wiz_sambatype} = $type{$o->{var}{wiz_type}};
- },
- data => [
- { label => N("Samba type:"), val_ref => \$o->{var}{wiz_sambatype} },
- { label => N("Workgroup:"), val_ref => \$o->{var}{wiz_workgroup} },
- { label => N("Server banner:"), val_ref => \$o->{var}{wiz_banner} },
- { label => N("Log file:"), val_ref => \$o->{var}{wiz_log_file} },
- ],
- post => \&do_it,
- next => 'end'
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Samba server."),
- post => sub {
- store_samba_type($o->{var}{wiz_type});
- },
- no_back => 1,
- end => 1,
- next => 0
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Please relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
- };
-
-sub new {
- my ($class, $conf) = @_;
- bless $o, $class;
-}
-
-sub check() {
- $> and return 1;
- $wiz->{net}->is_dhcp and return 2;
- 0;
-}
-
-sub global_special_options() {
- # set charset
- $samba->{global}{'dos charset'} ||= "850";
- $samba->{global}{'unix charset'} ||= "ISO8859-1";
-
- # detect Samba type 3 is standalone
- if ($o->{var}{wiz_type} == "3") {
- $samba->{global}{security} = "share";
- exists $samba->{global}{domain_master} and delete $samba->{global}{domain_master};
- exists $samba->{global}{'domain logons'} and delete $samba->{global}{'domain logons'};
- exists $samba->{global}{'wins support'} and delete $samba->{global}{'wins support'};
- exists $samba->{global}{'os level'} and delete $samba->{global}{'os level'};
- } else {
- # so pdc, bdc or member
- $o->{var}{wiz_local_master} and $samba->{global}{'local master'} = $o->{var}{wiz_local_master};
- $o->{var}{wiz_preferred_master} and $samba->{global}{'preferred master'} = $o->{var}{wiz_preferred_master};
- $o->{var}{wiz_wins_server} and $samba->{global}{'wins server'} = $o->{var}{wiz_wins_server};
- $o->{var}{wiz_name_resolve_order} and $samba->{global}{'name resolve order'} = $o->{var}{wiz_name_resolve_order};
- $o->{var}{wiz_dns_proxy} and $samba->{global}{'dns proxy'} = $o->{var}{wiz_dns_proxy};
- $o->{var}{wiz_domain_master} and $samba->{global}{'domain master'} = $o->{var}{wiz_domain_master};
- $o->{var}{wiz_security} and $samba->{global}{security} = $o->{var}{wiz_security};
- $o->{var}{wiz_domain_logons} and $samba->{global}{'domain logons'} = $o->{var}{wiz_domain_logons};
- $o->{var}{wiz_oslevel} and $samba->{global}{'os level'} = $o->{var}{wiz_oslevel};
- $o->{var}{wiz_passdb_backend} and $samba->{global}{'passdb backend'} = $o->{var}{wiz_passdb_backend};
- $o->{var}{wiz_wins_support} and $samba->{global}{'wins support'} = $o->{var}{wiz_wins_support};
- $o->{var}{wiz_password_server} and $samba->{global}{'password server'} = $o->{var}{wiz_password_server};
- $o->{var}{wiz_admin_users} and $samba->{global}{'admin users'} = $o->{var}{wiz_admin_users};
- $samba->{global}{'add machine script'} = "/usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M '%u'";
- # ldap options if needed
- if ($o->{var}{wiz_passdb_backend_yn} =~ /yes/) {
- $samba->{global}{'ldap passwd sync'} = "yes";
- $samba->{global}{'add machine script'} and delete $samba->{global}{'add machine script'};
- $o->{var}{wiz_ldap_suffix} and $samba->{global}{'ldap suffix'} = $o->{var}{wiz_ldap_suffix};
- $o->{var}{wiz_ldap_admin_dn} and $samba->{global}{'ldap admin dn'} = $o->{var}{wiz_ldap_admin_dn};
- $o->{var}{wiz_passdb_backend} and $samba->{global}{'passdb backend'} = $o->{var}{wiz_passdb_backend};
- $o->{var}{wiz_ldap_machine_suffix} and $samba->{global}{'ldap machine suffix'} = $o->{var}{wiz_ldap_machine_suffix};
- $o->{var}{wiz_ldap_group_suffix} and $samba->{global}{'ldap group suffix'} = $o->{var}{wiz_ldap_group_suffix};
- $o->{var}{wiz_ldap_user_suffix} and $samba->{global}{'ldap user suffix'} = $o->{var}{wiz_ldap_user_suffix};
- } else {
- # delete ldap options if exist
- exists $samba->{global}{'passdb backend'} and delete $samba->{global}{'passdb backend'};
- exists $samba->{global}{'ldap admin dn'} and delete $samba->{global}{'ldap admin_dn'};
- exists $samba->{global}{'ldap suffix'} and delete $samba->{global}{'ldap suffix'};
- exists $samba->{global}{'ldap passwd sync'} and delete$samba->{global}{'ldap passwd sync'};
- exists $samba->{global}{'ldap machine suffix'} and delete $samba->{global}{'ldap machine suffix'};
- exists $samba->{global}{'ldap group suffix'} and delete $samba->{global}{'ldap group suffix'};
- exists $samba->{global}{'ldap user suffix'} and delete $samba->{global}{'ldap user suffix'};
- }
- }
-}
-
-sub store_samba_type {
- # write config file to store Samba type
- my ($type) = @_;
- output($wiz_samba_etc, <<EOF);
-# 1 = BDC - backup domain controller
-# 2 = PDC - primary domain controller
-# 3 = Standalone - standalone server
-# 4 = Member - member of a domain
-EOF
-
- append_to_file($wiz_samba_etc, "type=$type\n");
-}
-
-sub map_unxigroup_ntgroup {
- my $conf = "/etc/group";
- my @groups;
- foreach (cat_($conf)) {
- push @groups, $1 if m/^([^#:]+):[^:]+:([^:]+):/ and $2 > 499;
- }
- foreach (@groups) {
- system("net groupmap add unixgroup=$_ ntgroup=$_");
- }
-}
-
-sub write_conf_restart_smb {
- $samba->write_conf("/etc/samba/smb.conf");
- if (services::is_service_running('smb')) {
- services::restart('smb');
- } else { services::start('smb') }
-}
-
-# remember one variable cannot be commented and not in the same file.
-sub do_it {
- $::testing and return;
- # display a wait dialog box
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba server"), N("Configuring your Samba server..."));
- # global section
- $samba->{global}{workgroup} = $o->{var}{wiz_workgroup};
- exists $o->{var}{wiz_netbios_name} and $samba->{global}{"netbios name"} = $o->{var}{wiz_netbios_name};
- $samba->{global}{'server string'} = $o->{var}{wiz_banner};
-
- # add special global options
- global_special_options;
- map_unxigroup_ntgroup;
-
- # log level in global section
- $o->{var}{wiz_log_file} and $samba->{global}{'log file'} = $o->{var}{wiz_log_file};
- $o->{var}{wiz_log_level} and $samba->{global}{'log level'} = $o->{var}{wiz_log_level};
- $o->{var}{wiz_max_log_size} and $samba->{global}{'max log size'} = $o->{var}{wiz_max_log_size};
-
- write_conf_restart_smb();
- # remove wait message
- undef $w;
- check_started('smbd');
-}
-1;
diff --git a/samba_wizard/Sambaprint.pm b/samba_wizard/Sambaprint.pm
deleted file mode 100755
index d6816a13..00000000
--- a/samba_wizard/Sambaprint.pm
+++ /dev/null
@@ -1,304 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-# Copyright (C) 2005 Mandriva
-#
-# Authors: antoine Ginies <aginies -@- mandriva>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Sambaprint;
-use strict;
-
-use common;
-use services;
-use MDK::Wizard::Wizcommon;
-
-use Libconf::Templates;
-use Libconf::Glueconf::Samba::Smb_conf;
-
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-
-my $wiz_samba_etc = "/etc/sysconfig/wizard_samba";
-my @listshare;
-my @listprinters;
-
-my $o = {
- name => 'Samba printers wizard',
- var => {
- wiz_all_printers => '',
- wiz_printers => '', wiz_do_printer_sharing => '', wiz_printers_comment => '',
- wiz_printers_browseable => '', wiz_printers_guestok => '', wiz_printers_createmode => '',
- list_printers => '',
- },
- defaultimage => "/usr/share/wizards/samba_wizard/images/IC-sambaprt-48.png",
- };
-
-# we ask glueconf to give us the structure representing /etc/samba/smb.conf
-my $samba = new Libconf::Glueconf::Samba::Smb_conf({ filename => '/etc/samba/smb.conf'});
-
-#debug
-use Data::Dumper;
-print Dumper($samba);
-
-my %cprint = (
- 1 => N("Printers - configure your printers"),
- # 2 => N('Print - printers drivers'),
- );
-
-my @yesorno = qw(yes no); push @yesorno, "";
-
-$o->{pages} = {
- welcome => {
- name => N("You can enable or disable printers in your Samba server configuration."),
- no_back => 1,
- pre => sub {
- if (! -f $wiz_samba_etc) {
- $in->ask_warn(N("Information"), N("It seems that you haven't setup a Samba server. Please setup a Samba server with Samba wizard before manage your shares.")) or $in->exit;
- }
- $o->{var}{wiz_do_printer_sharing} = "0";
- },
- data => [
- # { label => "", val => \$o->{var}{wiz_todo}, list => [ keys %cprint ], format => sub { $cprint{$_[0]} } },
- { text => N("Enable printers in Samba?"), type => 'bool', val => \$o->{var}{wiz_do_printer_sharing} },
- ],
- post => sub {
- if ($o->{var}{wiz_do_printer_sharing} == 0) {
- return 'summary_disable';
- } else { return 'ask_printers' }
- },
- next => 'ask_printers',
- },
- ask_printers => {
- name => N("Printers are available.") . "\n\n" . N("Select which printers you want to be accessible from known users"),
- pre => sub {
- $o->{var}{list_printers} ||= [ list_printers() ];
- $o->{var}{wiz_box_list} ||= [];
- },
- data => [
- { text => N("Enable all printers"), type => 'bool', val => \$o->{var}{wiz_all_printers} },
- { val => \$o->{var}{wiz_box_list}, boolean_list => \$o->{var}{list_printers}, disabled => sub { $o->{var}{wiz_all_printers} and return 1; 0 } },
- ],
- next => 'ask_printers_options',
- },
- ask_printers_options => {
- name => N("Now you can configure your printers service. Change value only if you know what your are doing."),
- pre => sub {
- if ($samba->{printers}{comment}) {
- $o->{var}{wiz_printers_comment} ||= $samba->{printers}{comment};
- } else {
- $o->{var}{wiz_printers_comment} = "All Printers";
- }
- $o->{var}{wiz_printers_browseable} ||= $samba->{printers}{browseable} or $o->{var}{wiz_printers_browseable} = "no";
- $o->{var}{wiz_printers_guestok} ||= $samba->{printers}{'guest ok'} or $o->{var}{wiz_printers_guestok} = "yes";
- if ($samba->{printers}{'create mode'}) {
- $o->{var}{wiz_printers_createmode} ||= $samba->{printers}{'create mode'};
- } else {
- $o->{var}{wiz_printers_createmode} = "0700";
- }
- },
- post => sub {
- if ($o->{var}{wiz_do_homes} == 1) {
- return 'ask_homes';
- }
- },
- data => [
- { label => N("Comment:"), val => \$o->{var}{wiz_printers_comment} },
-# { label => N("Create mode:"), val => \$o->{var}{wiz_printers_createmode} },
- { label => N("Browseable:"), val => \$o->{var}{wiz_printers_browseable}, fixed_list => \@yesorno },
- { label => N("Guest ok:"), val => \$o->{var}{wiz_printers_guestok}, fixed_list => \@yesorno },
- ],
- next => 'summary',
- },
- summary => {
- name => N("Configuring Samba printers"),
- pre => sub {
- $o->{var}{wiz_sambatype} = $cprint{$o->{var}{wiz_type}};
- },
- data => [
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_printers_comment} },
- { label => N("Create mode:"), val_ref => \$o->{var}{wiz_printers_createmode} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_printers_browseable} },
- { label => N("Guest ok:"), val_ref => \$o->{var}{wiz_printers_guestok} },
- ],
- post => \&do_it,
- next => 'end',
- },
- summary_disable => {
- name => N("Disable Samba printers"),
- post => \&do_it,
- next => 'end',
- no_back => 1,
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Samba printer."),
- no_back => 1,
- end => 1,
- next => 0
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Please relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
- };
-
-sub new {
- my ($class, $conf) = @_;
- bless $o, $class;
-}
-
-sub check() {
- $> and return 1;
- $wiz->{net}->is_dhcp and return 2;
- 0;
-}
-
-#section has the name of the printer
-sub add_printer {
- my ($printer) = @_;
- $samba->{$printer}{printer} = $printer;
- $samba->{$printer}{printable} = 'yes';
-}
-
-sub remove_printer {
- my ($printer) = @_;
- delete $samba->{$printer};
-}
-
-sub list_printers_smbconf() {
- undef @listprinters;
- foreach my $clef (keys %$samba) {
- if ($samba->{$clef}{printable} =~ /yes/i) {
- print "$clef is a printer\n";
- push @listprinters, $clef;
- }
- }
- return @listprinters;
-}
-
-sub list_printers() {
- my @list if 0;
- return @list if @list;
- @list = sort grep /^(?!\#).+/, map {
- my ($printer) = split(':', $_);
- } cat_("/etc/printcap");
- if (@list) {
- @list;
- } else { () }
-}
-
-
-sub printer_sharing() {
- # create default section for printers with default value
- $samba->{global}{'printer adm'} = "\@adm";
- $samba->{printers};
- $samba->{printers}{comment} = $o->{var}{wiz_printers_comment};
- $samba->{printers}{browseable} = $o->{var}{wiz_printers_browseable};
- $samba->{printers}{'guest ok'} = $o->{var}{wiz_printers_guestok};
- $samba->{printers}{'create mode'} = $o->{var}{wiz_printers_createmode};
- # dont want user to change those value...
- $samba->{printers}{path} = "/var/spool/samba";
- $samba->{printers}{writable} = "no";
- $samba->{printers}{printable} = "yes";
- $samba->{printers}{'print command'} = "lpr-cups -P \%p -o raw \%s -r";
- $samba->{printers}{'use client driver'} = "yes";
- if ($o->{var}{wiz_box_list}) {
- for (my $i; $i < @{$o->{var}{wiz_box_list}}; $i++) {
- my $printer = $o->{var}{list_printers}[$i];
- if ($o->{var}{wiz_box_list}[$i]) {
- add_printer($printer);
- } else {
- remove_printer($printer);
- }
- }
- }
-}
-
-sub printer_section() {
- $samba->{'pdf-gen'};
- $samba->{'pdf-gen'}{path} = "/var/tmp";
- $samba->{'pdf-gen'}{'guest ok'} = "no";
- $samba->{'pdf-gen'}{printable} = "yes";
- $samba->{'pdf-gen'}{comment} = "PDF Generator (only valid users)";
- $samba->{'pdf-gen'}{printing} = "bsd";
- $samba->{'pdf-gen'}{'print command'} = "/usr/share/samba/scripts/print-pdf \"%s\" \"%H\" \"//%L/%u\" \"%m\" \"%I\" \"%J\" &";
- $samba->{'pdf-gen'}{'lpq command'} = "/bin/true";
-}
-
-sub printdollar_section() {
- $samba->{'print$'};
- $samba->{'print$'}{browseable} = "yes";
- $samba->{'print$'}{path} = "/var/lib/samba/printers";
- $samba->{'print$'}{browseable} = "yes";
- $samba->{'print$'}{'write list'} = "\@adm root";
- $samba->{'print$'}{'guest ok'} = "yes";
- $samba->{'print$'}{'inherit permissions'} = "yes";
-}
-
-sub get_printers() {
- if ($o->{var}{wiz_do_printer_sharing}) {
- my $string;
- $o->{var}{wiz_all_printers} and return "all printers";
- for (my $i; $i < @{$o->{var}{wiz_box_list}}; $i++) {
- $string .= "$o->{var}{list_printers}[$i]\n" if $o->{var}{wiz_box_list}[$i];
- }
- $string;
- }
- else {
- 'disabled';
- }
-}
-
-sub write_conf_restart_smb {
- $samba->write_conf("/etc/samba/smb.conf");
- if (services::is_service_running('smb')) {
- services::restart('smb');
- } else { services::start('smb') }
-}
-
-# remember one variable cannot be commented and not in the same file.
-sub do_it {
- $::testing and return;
- # display a wait dialog box
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba server"), N("Configuring your Samba server..."));
-
- # share printers
- if ($o->{var}{wiz_do_printer_sharing} == 1) {
- printer_sharing();
- printer_section();
- printdollar_section();
- } else {
- if ($o->{var}{wiz_box_list}) {
- for (my $i; $i < @{$o->{var}{wiz_box_list}}; $i++) {
- $o->{var}{list_printers}[$i] and remove_printer($o->{var}{list_printers}[$i]);
- }
- }
- $samba->{global}{'printer adm'} and delete $samba->{global}{'printer adm'};
- $samba->{printers} and delete $samba->{printers};
- $samba->{'print$'} and delete $samba->{'print$'};
- $samba->{'pdf-gen'} and delete $samba->{'pdf-gen'};
- }
-
- write_conf_restart_smb();
- # remove wait message
- undef $w;
- check_started('smbd');
- }
-1;
diff --git a/samba_wizard/Sambashare.pm b/samba_wizard/Sambashare.pm
deleted file mode 100755
index 9545feb2..00000000
--- a/samba_wizard/Sambashare.pm
+++ /dev/null
@@ -1,976 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-# Copyright (C) 2005 Mandriva
-#
-# Authors: antoine Ginies <aginies @ mandriva>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Sambashare;
-use strict;
-
-use common;
-use services;
-use MDK::Wizard::Wizcommon;
-
-use Libconf::Templates;
-use Libconf::Glueconf::Samba::Smb_conf;
-
-my $wiz = new MDK::Wizard::Wizcommon;
-my $in = interactive->vnew;
-
-my @listshare;
-my @listshare_tomodify;
-
-my $o = {
- name => 'Samba wizard',
- var => {
- wiz_do_homes => '',
- wiz_dir => '',
- wiz_share_comment => '', wiz_share_browseable => '', wiz_share_writable => '',
- wiz_write_list => '',
- wiz_read_list => '',
- wiz_hosts_deny => '',
- wiz_home_writable => '', wiz_home_browseable => '', wiz_home_createmode => '',
- wiz_home_comment => '',
- wiz_share_comment => '', wiz_share_browseable => '', wiz_share_writable => '',
- wiz_share_create_mask => '', wiz_share_dotfiles => '', wiz_share_hidefiles => '',
- wiz_selected_share => '',
- wiz_selected_share_comment => '',
- wiz_understanding => '',
- },
- needed_rpm => [ 'samba-server' ],
- defaultimage => "/usr/share/wizards/samba_wizard/images/IC-sambashare-48.png",
- };
-
-# we ask glueconf to give us the structure representing /etc/samba/smb.conf
-my $samba = new Libconf::Glueconf::Samba::Smb_conf({ filename => '/etc/samba/smb.conf'});
-
-#use Data::Dumper;
-#print Dumper($samba);
-
-my %level = (
- 1 => N("All - No access restriction"),
- 2 => N("My rules - Ask me allowed and denied hosts")
- );
-
-my %understanding = (
- 1 => N("Newbie - classical options"),
- 2 => N("Expert - advanced options"),
- );
-
-my %menu_root_share = (
- 1 => N("Add/remove/modify share (expert only)"),
- 2 => N("Special share (CDrom, Homes, Profiles)"),
- 3 => N("Public share"),
- 4 => N("User share"),
- );
-
-my %menu_special_share = (
- 1 => N("CDrom - share a CDrom"),
- 2 => N("Homes - share home user dir"),
- 3 => N("Profiles - profiles directory on the fly"),
- );
-
-my %menu_manage = (
- 1 => N("Add - add a share"),
- 2 => N("Remove - remove a share"),
- 3 => N("Modify - modify a share"),
- );
-
-my %share = (
- 1 => N("Add - add a share"),
- 2 => N("Remove - remove a share"),
- 3 => N("Modify - modify a share"),
- 4 => N("CDrom - share a CDrom"),
- 5 => N("Homes - share home user dir"),
- 6 => N("Profiles - profiles directory on the fly"),
- );
-
-my @yesorno = qw(yes no); push @yesorno, "";
-my @scase = qw(lower upper); push @scase, "";
-my $wiz_samba_etc = "/etc/sysconfig/wizard_samba";
-
-$o->{pages} = {
- welcome => {
- name => N("What do you want to do?") . "\n\n" . N("Manage, create special share, create public/user share"),
- pre => sub {
- if (! -f $wiz_samba_etc) {
- $in->ask_warn(N("Information"), N("It seems that you haven't setup a Samba server. Please setup a Samba server with Samba wizard before manage your shares.")) or $in->exit;
- }
- $o->{var}{wiz_share} = 0;
- },
- data => [
- { label => '', val => \$o->{var}{wiz_share}, type => 'list', list => [ sort keys %menu_root_share ], format => sub { $menu_root_share{$_[0]} } },
- ],
- post => sub {
- if ($o->{var}{wiz_share} == 1) {
- return 'manage_share' }
- elsif ($o->{var}{wiz_share} == 2) {
- return 'special_share' }
- elsif ($o->{var}{wiz_share} == 3) {
- return 'add_public_share' }
- elsif ($o->{var}{wiz_share} == 4) {
- return 'add_user_share' }
- },
- no_back => 1,
- },
- manage_share => {
- name => N("What do you want to do with your share?") . "\n\n" . N("add/remove/modify a share"),
- pre => sub { $o->{var}{manage_share} = 0 },
- data => [
- { label => '', val => \$o->{var}{manage_share}, type => 'list', list => [ keys %menu_manage ], format => sub { $menu_manage{$_[0]} } },
- ],
- post => sub {
- if ($o->{var}{manage_share} == 1) {
- return 'add_share' }
- elsif ($o->{var}{manage_share} == 2) {
- return 'choose_share_to_delete' }
- elsif ($o->{var}{manage_share} == 3) {
- return 'choose_share_to_modify' }
- },
- no_back => 1,
- },
- special_share => {
- name => N("Create a special share, what kind?"),
- pre => sub { $o->{var}{special_share} = 1 },
- data => [
- { label => '', val => \$o->{var}{special_share}, type => 'list', list => [ keys %menu_special_share ], format => sub { $menu_special_share{$_[0]} } },
- ],
- post => sub {
- if ($o->{var}{special_share} == 1) {
- return 'add_cdrom_share' }
- elsif ($o->{var}{special_share} == 2) {
- return 'add_homes' }
- elsif ($o->{var}{special_share} == 3) {
- return 'add_profiles' }
- },
- no_back => 1,
- },
-
- understanding => {
- name => N("Now I need to know your understanding in Samba server configuration"),
- data => [
- { label => N("What kind of user are you:"), val => \$o->{var}{wiz_understanding}, list => [ keys %understanding ], format => sub { $understanding{$_[0]} } },
- ],
- next => 'modify_share',
- },
- choose_share_to_delete => {
- name => N("Delete which share?") . "\n\n" . N("Please choose the share you want to remove."),
- pre => \&list_all_shares,
- data => [
- { label => '', type => 'list', val => \$o->{var}{wiz_selected_share}, list_ref => \@listshare },
- ],
- next => 'summary_delete',
- },
- choose_share_to_modify => {
- name => N("Modify which share?") . "\n\n" . N("Please choose the share you want to modify."),
- pre => \&list_all_shares_to_modify,
- data => [
- { label => '', type => 'list', val => \$o->{var}{wiz_selected_share}, list_ref => \@listshare_tomodify },
- ],
- post => sub { if ($o->{var}{wiz_selected_share} eq 'homes') { return 'modify_homes_share' }
- },
- next => 'understanding',
- },
- modify_homes_share => {
- name => N("Modify Homes share"),
- pre => sub {
- exists $samba->{homes}{comment} and $o->{var}{wiz_homes_commment} = $samba->{homes}{comment};
- exists $samba->{homes}{writable} and $o->{var}{wiz_homes_writable} = $samba->{homes}{writable};
- exists $samba->{homes}{browseable} and $o->{var}{wiz_homes_browseable} = $samba->{homes}{browseable};
- exists $samba->{homes}{'create mode'} and $o->{var}{wiz_homes_create_mode} = $samba->{homes}{'create mode'};
- exists $samba->{homes}{'create mask'} and $o->{var}{wiz_homes_create_mask} = $samba->{homes}{'create mask'};
- exists $samba->{homes}{'directory mask'} and $o->{var}{wiz_homes_directory_mask} = $samba->{homes}{'directory mask'};
- },
- data => [
- { label => N("Comment:"), val => \$o->{var}{wiz_homes_comment}, help => N("This is a text field that is seen next to a share when a client does a queries the server") },
- { label => N("Writable:"), val => \$o->{var}{wiz_homes_writable}, list_ref => \@yesorno },
- { label => N("Browseable:"), val => \$o->{var}{wiz_homes_browseable}, list_ref => \@yesorno },
- { label => N("Create mode:"), val => \$o->{var}{wiz_homes_create_mode} },
- { label => N("Create mask:"), val => \$o->{var}{wiz_homes_create_mask} },
- { label => N("Directory mask:"), val => \$o->{var}{wiz_homes_directory_mask} },
- ],
- complete => sub {
- map {
- if ($_ and !/^\d+$/) {
- $in->ask_warn(N("Error"), N("Create mask, create mode and directory mask should be numeric. ie: 0755.")) and return 1;
- }
- } $o->{var}{wiz_homes_create_mask}, $o->{var}{wiz_homes_directory_mask}, $o->{var}{wiz_homes_create_mode};
- },
- next => 'summary_modify_homes_share',
- },
- modify_share => {
- name => N("Modify a share"),
- pre => sub {
- if (!$o->{var}{wiz_selected_share}) {
- $in->ask_warn(N("Information"), N("There is no share to modify, please add one."));
- exit(1);
- } else {
- my $share = $o->{var}{wiz_selected_share};
- exists $samba->{$share}{comment} and $o->{var}{wiz_share_comment} = $samba->{$share}{comment};
- exists $samba->{$share}{writable} and $o->{var}{wiz_share_writable} = $samba->{$share}{writable};
- exists $samba->{$share}{browseable} and $o->{var}{wiz_share_browseable} = $samba->{$share}{browseable};
- exists $samba->{$share}{path} and $o->{var}{wiz_share_path} = $samba->{$share}{path};
- exists $samba->{$share}{public} and $o->{var}{wiz_share_public} = $samba->{$share}{public};
- }
- },
- complete => sub {
- if (!($o->{var}{wiz_share_comment})) {
- $in->ask_warn(N("Error"), N("Please enter a share comment."));
- return 1;
- }
- },
- post => sub {
- if ($o->{var}{wiz_understanding} == 1) {
- return 'summary_modify';
- } elsif ($o->{var}{wiz_understanding} == 2) {
- return 'modify_share_options';
- } else {
- print "perdu\n";
- }
- },
- data => [
- { label => N("Name of the share:"), val_ref => \$o->{var}{wiz_selected_share} },
- { label => N("Comment:"), val => \$o->{var}{wiz_share_comment}, help => N("This is a text field that is seen next to a share when a client does a queries the server") },
- { label => N("Path:"), val => \$o->{var}{wiz_share_path} },
- { label => N("Browseable:"), val => \$o->{var}{wiz_share_browseable}, list_ref => \@yesorno, help => N("Allows share to be displayed in list of share.") },
- { label => N("Writable:"), val => \$o->{var}{wiz_share_writable}, list_ref => \@yesorno, help => ('Inverted synonym for read only.') },
- { label => N("Public:"), val => \$o->{var}{wiz_share_public}, list_ref => \@yesorno },
- ],
- no_back => 1,
- next => 'modify_share_options',
- },
- modify_share_options => {
- name => N("Advanced options, step 1") . "\n\n" . N("Advanced options, use them if you know what you are doing.") . "\n" . N("If you choose Write list wizard will create the samba user without password. Use: smbpasswd [username] to redefine samba user password."),
- pre => sub {
- my $share = $o->{var}{wiz_selected_share};
- exists $samba->{$share}{'read list'} and $o->{var}{wiz_share_readlist} = $samba->{$share}{'read list'};
- exists $samba->{$share}{'write list'} and $o->{var}{wiz_share_writelist} = $samba->{$share}{'write list'};
- exists $samba->{$share}{'hide dot files'} and $o->{var}{wiz_share_dotfiles} = $samba->{$share}{'hide dot files'};
- exists $samba->{$share}{'hide files'} and $o->{var}{wiz_share_hidefiles} = $samba->{$share}{'hide files'};
- $o->{var}{wiz_owner} = "0";
- exists $samba->{$share}{'valid users'} and $o->{var}{wiz_share_valid_users} = $samba->{$share}{'valid users'};
- exists $samba->{$share}{'admin users'} and $o->{var}{wiz_share_admin_users} = $samba->{$share}{'admin users'};
- },
- data => [
- { label => N("Read list:"), val => \$o->{var}{wiz_share_readlist}, help => N("Specifies a list of users that have read-only access to a writable share. ie: anne") },
- { label => N("Write list:"), val => \$o->{var}{wiz_share_writelist}, help => N("Specifies a user that have read-write access to a share. ie: fred") },
- { label => N("User own directory:"), type => 'bool', val => \$o->{var}{wiz_owner} },
- { label => N("valid users"), val => \$o->{var}{wiz_share_valid_users}, help => N("To restrict the share to a particular user. If this is empty (the default) then any user can login. ie: guibo") },
- { label => N("admin users"), val => \$o->{var}{wiz_share_admin_users}, help => N("This is a list of users who will be granted administrative privileges on the share. This means that they will do all file operations as the super-user (root). You should use this option very carefully, as any user in this list will be able to do anything they like on the share, irrespective of file permissions.") },
- { label => N("Hide files:"), val => \$o->{var}{wiz_share_hidefiles}, help => N("The hide files option provides one or more directory or filename patterns to Samba. Any file matching this pattern will be treated as a hidden file from the perspective of the client. ie: /.icewm/") },
- { label => N("Hide dot files:"), val => \$o->{var}{wiz_share_dotfiles}, list_ref => \@yesorno, help => N("The hide dot files option hides any files on the server that begin with a dot (.)") },
- ],
- complete => sub {
- map { my @users = split(" ", $_);
- foreach my $user (@users) {
- print "$user\n";
- if ($user and !any { /^$user:/ } cat_("/etc/passwd")) {
- $in->ask_warn(N("Error"), N("Please provide a system user, %s not present.", $user));
- return 1; $_;
- }
- }
- } $o->{var}{wiz_share_writelist}, $o->{var}{wiz_share_readlist}, $o->{var}{wiz_share_valid_users};
- },
- next => 'modify_share_options2',
- },
- modify_share_options2 => {
- name => N("Advanced options, step 2") . "\n\n" . N("Advanced options, use them only if you know what you are doing."),
- pre => sub {
- my $share = $o->{var}{wiz_selected_share};
- exists $samba->{$share}{'preserve case'} and $o->{var}{wiz_share_preserve_case} = $samba->{$share}{'preserve case'};
- exists $samba->{$share}{'short preserve case'} and $o->{var}{wiz_share_short_preserve_case} = $samba->{$share}{'short preserve case'};
- exists $samba->{$share}{'create mask'} and $o->{var}{wiz_share_create_mask} = $samba->{$share}{'create mask'} or $samba->{$share}{'create mask'} = "664";
- exists $samba->{$share}{'directory mask'} and $o->{var}{wiz_share_directory_mask} = $samba->{$share}{'directory mask'} or $samba->{$share}{'directory mask'} = 775;
- exists $samba->{$share}{'force create mode'} and $o->{var}{wiz_share_force_create_mode} = $samba->{$share}{'force create mode'};
- exists $samba->{$share}{'force directory mode'} and $o->{var}{wiz_share_force_directory_mode} = $samba->{$share}{'force directory mode'};
- exists $samba->{$share}{'force group'} and $o->{var}{wiz_share_force_group} = $samba->{$share}{'force group'};
- exists $samba->{$share}{'default case'} and $o->{var}{wiz_share_default_case} = $samba->{$share}{'default case'};
- },
- data => [
-# { label => N("create mask"), val => \$o->{var}{wiz_share_create_mask}, help => N("When a file is created, the necessary permissions are calculated according to the mapping from DOS modes to UNIX permissions, and the resulting UNIX mode is then bit-wise \'AND\'ed with this parameter. This parameter may be thought of as a bit-wise MASK for the UNIX modes of a file. Any bit not set here will be removed from the modes set on a file when it is created.") },
- { label => N("force create mode"), val => \$o->{var}{wiz_share_force_create_mode}, help => N("This parameter specifies a set of UNIX mode bit permissions that will always be set on a file created by Samba. This is done by bitwise \'OR\'ing these bits onto the mode bits of a file that is being created or having its permissions changed. The default for this parameter is (in octal) 000. ie: force create mode = 0700 ") },
- { label => N("force directory mode"), val => \$o->{var}{wiz_share_force_directory_mode}, help => N("This parameter specifies a set of UNIX mode bit permissions that will always be set on a directory created by Samba. This is done by bitwise \'OR\'ing these bits onto the mode bits of a directory that is being created. The default for this parameter is (in octal) 0000 which will not add any extra permission bits to a created directory. ie: force directory mode = 0755") },
- { label => N("force group"), val => \$o->{var}{wiz_share_force_group}, help => N("This specifies a UNIX group name that will be assigned as the default primary group for all users connecting to this service. This is useful for sharing files by ensuring that all access to files on service will use the named group for their permissions checking. ie: force group = agroup") },
- { label => N("default case"), val => \$o->{var}{wiz_share_default_case}, list_ref => \@scase, help => N("lower or upper") },
- { label => N("preserve case"), val => \$o->{var}{wiz_share_preserve_case}, list_ref => \@yesorno, help => N("This controls if new filenames are created with the case that the client passes, or if they are forced to be the default case") },
- ],
- complete => sub {
- map {
- if ($_ and $_ !~ /^\d+$/) {
- $in->ask_warn(N("Error"), N("Create mask, force directory mode and force create mode should be numeric. ie: 0755.")) and return 1;
- }
- } $o->{var}{wiz_share_create_mask}, $o->{var}{wiz_share_force_directory_mode}, $o->{var}{wiz_share_force_create_mode};
- },
- next => 'summary_modify',
- },
- add_share => {
- name => N("Add a share") . "\n" . N("Comment: description of the share") . "\n" . N("Browseable: view share") . "\n" . N("Writable: user can write in the share"),
- data => [
- { label => N("Name of the share:"), val => \$o->{var}{wiz_addshare_name} },
- { label => N("Comment:"), val => \$o->{var}{wiz_addshare_comment} },
- { label => N("Path:"), val => \$o->{var}{wiz_addshare_path} },
- { label => N("Browseable:"), val => \$o->{var}{wiz_addshare_browseable}, list_ref => \@yesorno, help => N("Allows share to be displayed in list of share.") },
- { label => N("Public:"), val => \$o->{var}{wiz_addshare_public}, list_ref => \@yesorno },
- ],
- complete => sub {
- foreach my $clef (keys %$samba) {
- if ($clef =~ /$o->{var}{wiz_addshare_name}/) {
- $in->ask_warn(N("Error"), N("Share with the same name already exist or share name empty, please choose another name."));
- return 1;
- }
- }
- if (!$o->{var}{wiz_addshare_path}) {
- $in->ask_warn(N("Error"), N("Can\'t create the directory, please enter a correct path.")) and return 1;
- }
- if (!$o->{var}{wiz_addshare_comment}) {
- $in->ask_warn(N("Error"), N("Please enter a comment for this share.")) and return 1;
- }
- if (! -d $o->{var}{wiz_addshare_path}) {
- mkdir_p($o->{var}{wiz_addshare_path}) or $in->ask_warn(N("Error"), N("Can\'t create the directory, please enter a correct path."));
-
- return 1;
- } else { return 0 }
- },
- next => 'add_share_options',
- no_back => 1,
- },
- add_cdrom_share => {
- name => N("Share a CDROM"),
- pre => sub {
- if ($samba->{cdrom}{comment}) {
- $o->{var}{wiz_cdrom_comment} = $samba->{cdrom}{comment};
- } else {
- $o->{var}{wiz_cdrom_comment} = "%L CDrom";
- }
- if ($samba->{cdrom}{path}) {
- $o->{var}{wiz_cdrom_path} = $samba->{cdrom}{path};
- } else {
- $o->{var}{wiz_cdrom_path} = "/mnt/cdrom";
- }
- $o->{var}{wiz_cdrom_browseable} = "yes";
- $o->{var}{wiz_cdrom_pre} = "/bin/mount /mnt/cdrom";
- $o->{var}{wiz_cdrom_post} = "/bin/umount /mnt/cdrom";
- $o->{var}{wiz_cdrom_public} = "yes";
- },
- data => [
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_cdrom_comment} },
- { label => N("CDrom path:"), val_ref => \$o->{var}{wiz_cdrom_path} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_cdrom_browseable} },
- { label => N("Root preexec:"), val_ref => \$o->{var}{wiz_cdrom_pre} },
- { label => N("Root postexec:"), val_ref => \$o->{var}{wiz_cdrom_post} },
- { label => N("Public:"), val_ref => \$o->{var}{wiz_cdrom_public} },
- ],
- next => 'summary_addcdromshare',
- },
- add_user_share => {
- name => N("Add a user share") . "\n",
- pre => sub {
- $o->{var}{wiz_add_user_share_browseable} = "yes";
- $o->{var}{wiz_add_user_share_public} = "no";
- $o->{var}{wiz_add_user_share_createmode} = "0700";
- $o->{var}{wiz_add_user_share_createmask} = "664";
- $o->{var}{wiz_add_user_share_directorymask} = "775";
- },
- data => [
- { label => N("Name of the share:"), val => \$o->{var}{wiz_add_user_share_name} },
- { label => N("Comment:"), val => \$o->{var}{wiz_add_user_share_comment} },
- { label => N("Path:"), val => \$o->{var}{wiz_add_user_share_path} },
- { label => N("Write list:"), val => \$o->{var}{wiz_add_user_share_writelist} },
- { label => N("Read list:"), val => \$o->{var}{wiz_add_user_share_readlist} },
- ],
- complete => sub {
- foreach my $clef (keys %$samba) {
- if ($clef =~ /$o->{var}{wiz_add_user_share_name}/) {
- $in->ask_warn(N("Error"), N("Share with the same name already exist or share name empty, please choose another name."));
- return 1;
- }
- }
- if (!$o->{var}{wiz_add_user_share_path}) {
- $in->ask_warn(N("Error"), N("Can\'t create the directory, please enter a correct path.")) and return 1;
- }
- if (!$o->{var}{wiz_add_user_share_comment}) {
- $in->ask_warn(N("Error"), N("Please enter a comment for this share.")) and return 1;
- }
- if (! -d $o->{var}{wiz_add_user_share_path}) {
- mkdir_p($o->{var}{wiz_add_user_share_path}) or $in->ask_warn(N("Error"), N("Can\'t create the directory, please enter a correct path."));
- return 1;
- } else { return 0 }
- map { my @users = split(" ", $_);
- foreach my $user (@users) {
- if ($user and !any { /^$user:/ } cat_("/etc/passwd")) {
- $in->ask_warn(N("Error"), N("Please provide a system user, %s not present.", $user));
- return 1; $_;
- }
- }
- } $o->{var}{wiz_add_user_share_writelist}, $o->{var}{wiz_add_user_share_readlist};
- },
- next => 'summary_add_user_share',
- },
- add_public_share => {
- name => N("Add a public share"),
- pre => sub {
- $o->{var}{wiz_add_public_share_browseable} = "yes";
- $o->{var}{wiz_add_public_share_public} = "yes";
- $o->{var}{wiz_add_public_share_createmode} = "0700";
- $o->{var}{wiz_add_public_owner} = "";
- $o->{var}{wiz_add_public_share_createmask} = "664";
- $o->{var}{wiz_add_public_share_directorymask} = "775";
- },
- data => [
- { label => N("Name of the share:"), val => \$o->{var}{wiz_add_public_share_name} },
- { label => N("Comment:"), val => \$o->{var}{wiz_add_public_share_comment} },
- { label => N("Path:"), val => \$o->{var}{wiz_add_public_share_path} },
- { label => N("Writable:"), val => \$o->{var}{wiz_add_public_share_writable}, list_ref => \@yesorno },
- { label => N("Public:"), val_ref => \$o->{var}{wiz_add_public_share_public} },
-
- ],
- complete => sub {
- foreach my $clef (keys %$samba) {
- if ($clef =~ /$o->{var}{wiz_add_public_share_name}/) {
- $in->ask_warn(N("Error"), N("Share with the same name already exist or share name empty, please choose another name."));
- return 1;
- }
- }
- if ($o->{var}{wiz_add_public_share_writable} eq 'yes') {
- $in->ask_okcancel(N("WARNING"), N("Be careful, you define your public share writable. This wizard will change permission to nobody.users, so do not use this feature on a home directory !")) or return 1;
- }
- if (!$o->{var}{wiz_add_public_share_path}) {
- $in->ask_warn(N("Error"), N("Can't create the directory, please enter a correct path.")) and return 1;
- }
- if (!$o->{var}{wiz_add_public_share_comment}) {
- $in->ask_warn(N("Error"), N("Please enter a comment for this share.")) and return 1;
- }
- if (! -d $o->{var}{wiz_add_public_share_path}) {
- mkdir_p($o->{var}{wiz_add_public_share_path}) or $in->ask_warn(N("Error"), N("Can't create the directory, please enter a correct path."));
- return 1;
- } else { return 0 }
- },
- next => 'summary_add_public_share',
- },
- add_share_options => {
- name => N("Add a share") . "\n" . N("If you don't want to use one of this options, leave it blank."),
- pre => sub {
- $o->{var}{wiz_addshare_createmode} = "0700";
- $o->{var}{wiz_owner} = "0";
- $o->{var}{wiz_addshare_createmask} = "664";
- $o->{var}{wiz_addshare_directorymask} = "775";
- },
- data => [
- { label => N("Writable:"), val => \$o->{var}{wiz_addshare_writable}, list_ref => \@yesorno },
-# { label => N("Create mask:"), val => \$o->{var}{wiz_addshare_createmask} },
- { label => N("Read list:"), val => \$o->{var}{wiz_addshare_readlist}, help => N("Specifies a list \of users that have read-only access to a writable share. ie: aginies") },
- { label => N("Write list:"), val => \$o->{var}{wiz_addshare_writelist}, help => N("Specifies a user that have read-write access to a share. ie: guibo") },
- { label => N("User own directory:"), type => 'bool', val => \$o->{var}{wiz_owner} },
- { label => N("Hide dot files:"), val => \$o->{var}{wiz_addshare_dotfiles}, list_ref => \@yesorno, help => N("The hide dot files option hides any files on the server that begin with a dot (.)") },
- { label => N("Hide files:"), val => \$o->{var}{wiz_addshare_hidefiles}, help => N("The hide files option provides one or more directory or filename patterns to Samba. Any file matching this pattern will be treated as a hidden file from the perspective of the client. ie: /.icewm/") },
- ],
- complete => sub {
- map { my @users = split(" ", $_);
- foreach my $user (@users) {
- if ($user and !any { /^$user:/ } cat_("/etc/passwd")) {
- $in->ask_warn(N("Error"), N("Please provide a system user, %s not present.", $user));
- return 1; $_;
- }
- }
- } $o->{var}{wiz_addshare_writelist}, $o->{var}{wiz_addshare_readlist};
- if ($o->{var}{wiz_addshare_createmask} and $o->{var}{wiz_addshare_createmask} !~ /^\d+$/) {
- $in->ask_warn(N("Error"), N("Create mask should be a number. ie: 0755.")) and return 1;
- }
- },
- next => 'summary_addshare',
- },
- add_homes => {
- name => N("Users home options") . "\n" . N("You have selected to allow user access their home directories via samba but you/they must use smbpasswd to set a password.") . "\n" . N("Comment: description of users home directory") . "\n" . N("Browseable: view share") . "\n" . N("Writable: user can write in their home") . "\n" . N("Create mode: man chmod for more info"),
- pre => sub {
- if ($samba->{homes}{comment}) {
- $o->{var}{wiz_home_comment} ||= $samba->{homes}{comment};
- } else {
- $o->{var}{wiz_home_comment} = "Home Directories";
- }
- $o->{var}{wiz_home_browseable} ||= $samba->{homes}{browseable};
- $o->{var}{wiz_home_writable} ||= $samba->{homes}{writable};
- if ($samba->{homes}{'create mode'}) {
- $o->{var}{wiz_home_createmode} ||= $samba->{homes}{'create mode'};
- } else {
- $o->{var}{wiz_home_createmode} = "0755";
- }
- },
- data => [
- { label => N("Comment:"), val => \$o->{var}{wiz_home_comment} },
- { label => N("Browseable:"), val => \$o->{var}{wiz_home_browseable}, list_ref => \@yesorno },
- { label => N("Writable:"), val => \$o->{var}{wiz_home_writable}, list_ref => \@yesorno },
-# { label => N("Create mode:"), val => \$o->{var}{wiz_home_createmode} },
- ],
- next => 'summary_homeshare',
- complete => sub {
- if ($o->{var}{wiz_home_createmode} and $o->{var}{wiz_home_createmode} !~ /^\d+$/) {
- $in->ask_warn(N("Error"), N("Create mode should be a number. ie: 0755.")) and return 1;
- }
- },
- },
- add_profiles => {
- name => N("Specific roving profile share, use the user's home directory"),
- pre => sub {
- $o->{var}{wiz_profiles_path} = "/var/lib/samba/profiles";
- $o->{var}{wiz_profiles_comment} = "User Profiles";
- $o->{var}{wiz_profiles_browseable} = "no";
- $o->{var}{wiz_profiles_guest_ok} = "yes";
- $o->{var}{wiz_profiles_writable} = "yes";
- },
- data => [
- { label => N("Path:"), val_ref => \$o->{var}{wiz_profiles_path} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_profiles_browseable} },
- { label => N("Guest access:"), val_ref => \$o->{var}{wiz_profiles_guest_ok} },
- { label => N("Writable:"), val_ref => \$o->{var}{wiz_profiles_writable} },
- ],
- next => 'end_add_profiles',
- post => \&do_it_add_profiles,
- },
- summary_homeshare => {
- name => N("Summary add home share") . "\n\n" . N("If you really want to add this share, click the Next button or use the Back button."),
- post => \&do_it_add_homeshare,
- data => [
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_home_comment} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_home_browseable}, },
- { label => N("Writable:"), val_ref => \$o->{var}{wiz_home_writable}, },
- { label => N("Create mode:"), val_ref => \$o->{var}{wiz_home_createmode} },
- ],
- next => 'end_add_share',
- },
- summary_modify => {
- name => N("Summary modify a share") . "\n\n" . N("If you really want to modify this share, click the Next button or use the Back button."),
- data => [
- { label => N("Name of the share:"), val_ref => \$o->{var}{wiz_selected_share} },
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_share_comment} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_share_browseable} },
- { label => N("Writable:"), val_ref => \$o->{var}{wiz_share_writable} },
- { label => N("Public:"), val_ref => \$o->{var}{wiz_share_public} },
- ],
- post => \&do_it_modify_share,
- next => 'end_modify_share',
- },
- summary_addcdromshare => {
- name => N("CDROM") . "\n\n" . N("If you really want to share a CDROM, click the Next button or use the Back button."),
- post => \&do_it_add_cdromshare,
- data => [
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_cdrom_comment} },
- { label => N("Cdrom path:"), val_ref => \$o->{var}{wiz_cdrom_path} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_cdrom_browseable} },
- { label => N("Root preexec:"), val_ref => \$o->{var}{wiz_cdrom_pre} },
- { label => N("Root postexec:"), val_ref => \$o->{var}{wiz_cdrom_post} },
- { label => N("Public:"), val_ref => \$o->{var}{wiz_cdrom_public} },
- ],
- next => 'end_add_share',
- },
- summary_addshare => {
- name => N("Summary add share") . "\n\n" . N("If you really want to add this share, click the Next button or use the Back button."),
- post => \&do_it_add_share,
- data => [
- { label => N("Name of the share:"), val_ref => \$o->{var}{wiz_addshare_name} },
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_addshare_comment} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_addshare_browseable} },
- { label => N("Create mask:"), val_ref => \$o->{var}{wiz_addshare_createmask} },
- { label => N("Writable:"), val_ref => \$o->{var}{wiz_addshare_writable} },
- { label => N("Public:"), val_ref => \$o->{var}{wiz_addshare_public} },
- { label => N("Read list:"), val_ref => \$o->{var}{wiz_addshare_readlist} },
- { label => N("Write list:"), val_ref => \$o->{var}{wiz_addshare_writelist} },
- { label => N("Hide dot files:"), val_ref => \$o->{var}{wiz_addshare_dotfiles} },
- ],
- next => 'end_add_share',
- },
- summary_delete => {
- name => N("Summary remove a share") . "\n\n" . N("If you really want to remove this share, click the Next button or use the Back button."),
- pre => sub {
- my $dshare = $o->{var}{wiz_selected_share};
- $o->{var}{wiz_selected_share_comment} = $samba->{$dshare}{comment};
- },
- data => [
- { label => N("Delete this share:"), val_ref => \$o->{var}{wiz_selected_share} },
- { label => N("Comment for this share:"), val_ref => \$o->{var}{wiz_selected_share_comment} },
- ],
- post => \&do_it_remove_share,
- next => 'end_delete_share',
- no_back => 1,
- },
- summary_modify_homes_share => {
- name => N("Summary of modify homes share"),
- data => [
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_homes_comment} },
- { label => N("Writable:"), val_ref => \$o->{var}{wiz_homes_writable} },
- { label => N("Browseable:"), val_ref => \$o->{var}{wiz_homes_browseable} },
- { label => N("Create mode:"), val_ref => \$o->{var}{wiz_homes_create_mode} },
- { label => N("Create mask:"), val_ref => \$o->{var}{wiz_homes_create_mask} },
- { label => N("Directory mask:"), val_ref => \$o->{var}{wiz_homes_directory_mask} },
- ],
- post => \&do_it_modify_homes_share,
- next => 'end_add_user_share',
- no_back => 1,
- },
- summary_add_user_share => {
- name => N("Summary of add a user share") . "\n\n" . N("If you really want to add this share, click the Next button or use the Back button."),
- data => [
- { label => N("Name of the share:"), val_ref => \$o->{var}{wiz_add_user_share_name} },
- { label => N("Comment:"), val_ref => \$o->{var}{wiz_add_user_share_comment} },
- { label => N("Path:"), val_ref => \$o->{var}{wiz_add_user_share_path} },
- { label => N("Write list:"), val_ref => \$o->{var}{wiz_add_user_share_writelist} },
- ],
- post => \&do_it_add_user_share,
- next => 'end_add_user_share',
- },
- summary_add_public_share => {
- name => N("Summary of add a public share") . "\n\n" . N("If you really want to add this share, click the Next button or use the Back button."),
- data => [
- { label => N("Name of the share:"), val => \$o->{var}{wiz_add_public_share_name} },
- { label => N("Comment:"), val => \$o->{var}{wiz_add_public_share_comment} },
- { label => N("Path:"), val => \$o->{var}{wiz_add_public_share_path} },
- { label => N("Public:"), val_ref => \$o->{var}{wiz_add_public_share_public} },
- { label => N("Writable:"), val_ref => \$o->{var}{wiz_add_public_share_writable} },
- ],
- post => \&do_it_add_public_share,
- next => 'end_add_public_share',
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Samba."),
- post => sub {
- store_samba_type($o->{var}{wiz_type});
- },
- end => 1,
- next => 0,
- no_back => 1,
- },
- end_modify_share => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully modified your share."),
- end => 1,
- next => 0,
- no_back => 1,
- },
- end_add_share => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully added your share."),
- end => 1,
- next => 0,
- no_back => 1,
- },
- end_add_user_share => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully added your user share."),
- end => 1,
- next => 0,
- no_back => 1,
- },
- end_add_public_share => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully added your public share."),
- end => 1,
- next => 0,
- no_back => 1,
- },
- end_add_profiles => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully added your Profiles share."),
- end => 1,
- next => 0,
- no_back => 1,
- },
- end_delete_share => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully removed your share."),
- end => 1,
- next => 0,
- no_back => 1,
- },
- error_end => {
- name => N("Failed"),
- data => [ { label => N("Please relaunch drakwizard, and try to change some parameters.") } ],
- no_back => 1,
- end => 1,
- next => 0,
- },
- };
-
-sub new {
- my ($class, $conf) = @_;
- bless $o, $class;
-}
-
-sub check() {
- $> and return 1;
- $wiz->{net}->is_dhcp and return 2;
- 0;
-}
-
-sub list_all_shares_to_modify {
- undef @listshare_tomodify;
- foreach my $clef (keys %$samba) {
- if ($samba->{$clef}{printable} =~ /yes/i) {
- print "$clef is a printer\n";
- } elsif ($clef =~ /global/ or $clef =~ /print\$/ or $clef =~ /cdrom/ or $clef =~ /profiles/) {
- print "unwanted\n";
- } else {
- push @listshare_tomodify, $clef;
- }
- }
- return @listshare_tomodify;
-}
-
-sub list_all_shares() {
- undef @listshare;
- foreach my $clef (keys %$samba) {
- if ($samba->{$clef}{printable} =~ /yes/i) {
- print "$clef is a printer\n";
- } elsif ($clef =~ /global/ or $clef =~ /print\$/) {
- print "unwanted\n";
- } else {
- push @listshare, $clef;
- }
- }
- return @listshare;
-}
-
-sub write_conf_restart_smb {
- $samba->write_conf("/etc/samba/smb.conf");
- if (services::is_service_running('smb')) {
- services::restart('smb');
- } else { services::start('smb') }
-}
-
-sub do_it_remove_share {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
- my $share = $o->{var}{wiz_selected_share};
- delete $samba->{$share};
- if ($share =~ /Profiles/) { delete $samba->{global}{'logon home'} }
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-
-sub create_smbuser {
- my ($list) = @_;
- my @users = split(" ", $list);
- foreach my $user (@users) {
- if (!any { /^$user:/ } cat_("/etc/samba/smbpasswd")) {
- system("smbpasswd -a $user -n");
- }
- }
-}
-
-sub do_it_modify_share {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $share = $o->{var}{wiz_selected_share};
- $samba->{$share};
- $samba->{$share}{path} = $o->{var}{wiz_share_path};
- if (!-d $samba->{$share}{path}) {
- mkdir($samba->{$share}{path});
- if (!-d $samba->{$share}{path}) {
- $in->ask_warn(N("Error"), N("Can\'t create %s. Please check why wizard can\'t create this directory.", $samba->{$share}{path}));
- }
- }
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
- $samba->{$share}{comment} = $o->{var}{wiz_share_comment};
- $o->{var}{wiz_share_browseable} and $samba->{$share}{browseable} = $o->{var}{wiz_share_browseable};
- $o->{var}{wiz_share_writable} and $samba->{$share}{writable} = $o->{var}{wiz_share_writable};
- $o->{var}{wiz_share_public} and $samba->{$share}{public} = $o->{var}{wiz_share_public};
- # master level
- if ($o->{var}{wiz_understanding} == 2) {
- $o->{var}{wiz_share_readlist} and $samba->{$share}{'read list'} = $o->{var}{wiz_share_readlist};
- if ($o->{var}{wiz_share_writelist}) {
- $samba->{$share}{'write list'} = $o->{var}{wiz_share_writelist};
- if ($o->{var}{wiz_owner}) {
- system("chown -R $o->{var}{wiz_share_writelist}.users $o->{var}{wiz_share_path}");
- }
- create_smbuser($o->{var}{wiz_share_writelist});
- }
- if ($o->{var}{wiz_share_valid_users}) {
- $samba->{$share}{'valid users'} = $o->{var}{wiz_share_valid_users};
- create_smbuser($o->{var}{wiz_share_valid_users});
- }
- if ($o->{var}{wiz_share_admin_users}) {
- $samba->{$share}{'admin users'} = $o->{var}{wiz_share_admin_users};
- create_smbuser($o->{var}{wiz_share_admin_users});
- }
-
- $o->{var}{wiz_share_dotfiles} and $samba->{$share}{'hide dot files'} = $o->{var}{wiz_share_dotfiles};
- $o->{var}{wiz_share_hidefiles} and $samba->{$share}{'hide files'} = $o->{var}{wiz_share_hidefiles};
- $o->{var}{wiz_share_preserve_case} and $samba->{$share}{'preserve case'} = $o->{var}{wiz_share_preserve_case};
- $o->{var}{wiz_share_short_preserve_case} and $samba->{$share}{'short preserve case'} = $o->{var}{wiz_share_short_preserve_case};
- $o->{var}{wiz_share_create_mask} and $samba->{$share}{'create mask'} = $o->{var}{wiz_share_create_mask};
- $o->{var}{wiz_share_directory_mask} and $samba->{$share}{'directory mask'} = $o->{var}{wiz_share_directory_mask};
- $o->{var}{wiz_share_force_create_mode} and $samba->{$share}{'force create mode'} = $o->{var}{wiz_share_force_create_mode};
- $o->{var}{wiz_share_force_directory_mode} and $samba->{$share}{'force directory mode'} = $o->{var}{wiz_share_force_directory_mode};
- $o->{var}{wiz_share_force_group} and $samba->{$share}{'force group'} = $o->{var}{wiz_share_force_group};
- $o->{var}{wiz_share_default_case} and $samba->{$share}{'default case'} = $o->{var}{wiz_share_default_case};
- }
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-sub do_it_add_profiles {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
- $samba->{Profiles}{path} = $o->{var}{wiz_profiles_path};
- $samba->{global}{'logon home'} = "\\\\%L\\Profiles\\%u";
- $samba->{Profiles}{browseable} = $o->{var}{wiz_profiles_browseable};
- $samba->{Profiles}{'guest ok'} = $o->{var}{wiz_profiles_guest_ok};
- $samba->{Profiles}{comment} = $o->{var}{wiz_profiles_comment};
- $samba->{Profiles}{writable} = $o->{var}{wiz_profiles_writable};
- $samba->{Profiles}{'root preexec'} = "PROFILE='/var/lib/samba/profiles/\%u'; if [ ! -e \$PROFILE ]; then mkdir -pm700 \$PROFILE; chown '\%u':'\%g' \$PROFILE;fi";
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-
-sub do_it_modify_homes_share {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba homes share"), N("Configuring your Samba server..."));
-
- $o->{var}{wiz_homes_commment} and $samba->{homes}{comment} = $o->{var}{wiz_homes_commment};
- $o->{var}{wiz_homes_writable} and $samba->{homes}{writable} = $o->{var}{wiz_homes_writable};
- $o->{var}{wiz_homes_browseable} and $samba->{homes}{browseable} = $o->{var}{wiz_homes_browseable};
- $o->{var}{wiz_homes_create_mode} and $samba->{homes}{'create mode'} = $o->{var}{wiz_homes_create_mode};
- $o->{var}{wiz_homes_create_mask} and $samba->{homes}{'create mask'} = $o->{var}{wiz_homes_create_mask};
- $o->{var}{wiz_homes_directory_mask} and $samba->{homes}{'directory mask'} = $o->{var}{wiz_homes_directory_mask};
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-
-sub do_it_add_cdromshare {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
- $samba->{cdrom}{comment} = $o->{var}{wiz_cdrom_comment};
- $samba->{cdrom}{path} = $o->{var}{wiz_cdrom_path};
- $samba->{cdrom}{browseable} = $o->{var}{wiz_cdrom_browseable};
- $samba->{cdrom}{'root preexec'} = $o->{var}{wiz_cdrom_pre};
- $samba->{cdrom}{'root postexec'} = $o->{var}{wiz_cdrom_post};
- $samba->{cdrom}{public} = $o->{var}{wiz_cdrom_public};
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-
-sub do_it_add_homeshare {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
- $samba->{homes};
- $samba->{homes}{comment} = $o->{var}{wiz_home_comment};
- $o->{var}{wiz_home_browseable} and $samba->{homes}{browseable} = $o->{var}{wiz_home_browseable};
- $o->{var}{wiz_home_writable} and $samba->{homes}{writable} = $o->{var}{wiz_home_writable};
- $o->{var}{wiz_home_createmode} and $samba->{homes}{'create mode'} = $o->{var}{wiz_home_createmode};
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-
-sub do_it_add_public_share {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $share = $o->{var}{wiz_add_public_share_name};
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
-
- $samba->{$share};
- $samba->{$share}{browseable} = $o->{var}{wiz_add_public_share_browseable};
- $samba->{$share}{public} = $o->{var}{wiz_add_public_share_public};
- $samba->{$share}{'create mask'} = $o->{var}{wiz_add_public_share_createmask};
- $samba->{$share}{'directory mask'} = $o->{var}{wiz_add_public_share_directorymask};
- $samba->{$share}{comment} = $o->{var}{wiz_add_public_share_comment};
- $samba->{$share}{path} = $o->{var}{wiz_add_public_share_path};
- if ($o->{var}{wiz_add_public_share_writable} eq 'yes') {
- $samba->{$share}{'writable'} = $o->{var}{wiz_add_public_share_writable};
- system("chown -R nobody.users $o->{var}{wiz_add_public_share_path}");
- }
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-
-}
-
-sub do_it_add_user_share {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $share = $o->{var}{wiz_add_user_share_name};
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
-
- $samba->{$share};
- $samba->{$share}{browseable} = $o->{var}{wiz_add_user_share_browseable};
- $samba->{$share}{public} = $o->{var}{wiz_add_user_share_public};
- $samba->{$share}{path} = $o->{var}{wiz_add_user_share_createmode};
- $samba->{$share}{'create mask'} = $o->{var}{wiz_add_user_share_createmask};
- $samba->{$share}{'directory mask'} = $o->{var}{wiz_add_user_share_directorymask};
- $samba->{$share}{comment} = $o->{var}{wiz_add_user_share_comment};
- $samba->{$share}{path} = $o->{var}{wiz_add_user_share_path};
-
- $samba->{$share}{'write list'} = $o->{var}{wiz_add_user_share_writelist};
- system("chown -R $o->{var}{wiz_add_user_share_writelist}.users $o->{var}{wiz_add_user_share_path}");
- create_smbuser($o->{var}{wiz_add_user_share_writelist});
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-
-}
-
-sub do_it_add_share {
- $::testing and return;
- my $in = 'interactive'->vnew('su', 'Samba');
- my $share = $o->{var}{wiz_addshare_name};
- $samba->{$share};
- $samba->{$share}{path} = $o->{var}{wiz_addshare_path};
- if (!-d $samba->{$share}{path}) {
- system("mkdir $samba->{$share}{path}");
- if (!-d $samba->{$share}{path}) {
- $in->ask_warn(N("Error"), N("Can\'t create %s. Please check why wizard can\'t create this directory.", $samba->{$share}{path}));
- }
- }
- my $w = $in->wait_message(N("Samba share"), N("Configuring your Samba server..."));
- $samba->{$share}{comment} = $o->{var}{wiz_addshare_comment};
- $o->{var}{wiz_addshare_browseable} and $samba->{$share}{browseable} = $o->{var}{wiz_addshare_browseable};
- $o->{var}{wiz_addshare_writable} and $samba->{$share}{writable} = $o->{var}{wiz_addshare_writable};
- $o->{var}{wiz_addshare_public} and $samba->{$share}{public} = $o->{var}{wiz_addshare_public};
- $o->{var}{wiz_addshare_dotfiles} and $samba->{$share}{'hide dot files'} = $o->{var}{wiz_addshare_dotfiles};
- $o->{var}{wiz_addshare_hidefiles} and $samba->{$share}{'hide files'} = $o->{var}{wiz_addshare_hidefiles};
- if ($o->{var}{wiz_addshare_readlist}) {
- $samba->{$share}{'read list'} = $o->{var}{wiz_addshare_readlist};
- create_smbuser($o->{var}{wiz_addshare_readlist});
- }
-
- if ($o->{var}{wiz_addshare_writelist}) {
- $samba->{$share}{'write list'} = $o->{var}{wiz_addshare_writelist};
- if ($o->{var}{wiz_owner}) {
- system("chown -R $o->{var}{wiz_addshare_writelist}.users $o->{var}{wiz_addshare_path}");
- }
- create_smbuser($o->{var}{wiz_addshare_writelist});
- }
- $o->{var}{wiz_addshare_createmask} and $samba->{$share}{'create mask'} = $o->{var}{wiz_addshare_createmask};
- $o->{var}{wiz_addshare_directorymask} and $samba->{$share}{'directory mask'} = $o->{var}{wiz_addshare_directorymask};
-
-
- write_conf_restart_smb();
- undef $w;
- check_started('smbd');
-}
-
-1;
diff --git a/samba_wizard/images/IC-sambaprt-48.png b/samba_wizard/images/IC-sambaprt-48.png
deleted file mode 100644
index 9a5ea6b5..00000000
--- a/samba_wizard/images/IC-sambaprt-48.png
+++ /dev/null
Binary files differ
diff --git a/samba_wizard/images/IC-sambashare-48.png b/samba_wizard/images/IC-sambashare-48.png
deleted file mode 100644
index 9a69c841..00000000
--- a/samba_wizard/images/IC-sambashare-48.png
+++ /dev/null
Binary files differ
diff --git a/samba_wizard/images/sambasrv.png b/samba_wizard/images/sambasrv.png
deleted file mode 100644
index 397ee501..00000000
--- a/samba_wizard/images/sambasrv.png
+++ /dev/null
Binary files differ
diff --git a/samba_wizard/scripts/smb.conf.default b/samba_wizard/scripts/smb.conf.default
deleted file mode 100644
index 939ec9a5..00000000
--- a/samba_wizard/scripts/smb.conf.default
+++ /dev/null
@@ -1,524 +0,0 @@
-
-# This is the main Samba configuration file. You should read the
-# smb.conf(5) manual page in order to understand the options listed
-# here. Samba has a huge number of configurable options (perhaps too
-# many!) most of which are not shown in this example
-#
-# Any line which starts with a ; (semi-colon) or a # (hash)
-# is a comment and is ignored. In this example we will use a #
-# for commentry and a ; for parts of the config file that you
-# may wish to enable
-#
-# NOTE: Whenever you modify this file you should run the command "testparm"
-# to check that you have not made any basic syntactic errors.
-#
-#======================= Global Settings =====================================
-[global]
-
-# 1. Server Naming Options:
-# workgroup = NT-Domain-Name or Workgroup-Name
- workgroup = MDKGROUP
-
-# netbios name is the name you will see in "Network Neighbourhood",
-# but defaults to your hostname
-# netbios name = <name_of_this_server>
-
-# server string is the equivalent of the NT Description field
- server string = Samba Server %v
-
-# Message command is run by samba when a "popup" message is sent to it.
-# The example below is for use with LinPopUp:
-; message command = /usr/bin/linpopup "%f" "%m" %s; rm %s
-
-# 2. Printing Options:
-# CHANGES TO ENABLE PRINTING ON ALL CUPS PRINTERS IN THE NETWORK
-# (as cups is now used in linux-mandrake 7.2 by default)
-# if you want to automatically load your printer list rather
-# than setting them up individually then you'll need this
- printcap name = cups
- load printers = yes
-
-# It should not be necessary to spell out the print system type unless
-# yours is non-standard. Currently supported print systems include:
-# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
- printing = cups
-
-# Samba 2.2 supports the Windows NT-style point-and-print feature. To
-# use this, you need to be able to upload print drivers to the samba
-# server. The printer admins (or root) may install drivers onto samba.
-# Note that this feature uses the print$ share, so you will need to
-# enable it below.
-# printer admin = @<group> <user>
- printer admin = @adm
-# This should work well for winbind:
-# printer admin = @"Domain Admins"
-
-# 3. Logging Options:
-# this tells Samba to use a separate log file for each machine
-# that connects
- log file = /var/log/samba/log.%m
-
-# Put a capping on the size of the log files (in Kb).
- max log size = 50
-
-# Set the log (verbosity) level (0 <= log level <= 10)
-# log level = 3
-
-# 4. Security and Domain Membership Options:
-# This option is important for security. It allows you to restrict
-# connections to machines which are on your local network. The
-# following example restricts access to two C class networks and
-# the "loopback" interface. For more examples of the syntax see
-# the smb.conf man page. Do not enable this if (tcp/ip) name resolution does
-# not work for all the hosts in your network.
-# hosts allow = 192.168.1. 192.168.2. 127.
-
-# Uncomment this if you want a guest account, you must add this to /etc/passwd
-# otherwise the user "nobody" is used
-# guest account = pcguest
-# Allow users to map to guest:
- map to guest = bad user
-
-# Security mode. Most people will want user level security. See
-# security_level.txt for details.
- security = user
-# Use password server option only with security = server or security = domain
-# When using security = domain, you should use password server = *
-# password server = <NT-Server-Name>
-# password server = *
-
-# Password Level allows matching of _n_ characters of the password for
-# all combinations of upper and lower case.
-# password level = 8
-# username level = 8
-
-# You may wish to use password encryption. Please read
-# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
-# Do not enable this option unless you have read those documents
-# Encrypted passwords are required for any use of samba in a Windows NT domain
-# The smbpasswd file is only required by a server doing authentication, thus
-# members of a domain do not need one.
- encrypt passwords = yes
- smb passwd file = /etc/samba/smbpasswd
-
-# The following are needed to allow password changing from Windows to
-# also update the Linux system password.
-# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
-# NOTE2: You do NOT need these to allow workstations to change only
-# the encrypted SMB passwords. They allow the Unix password
-# to be kept in sync with the SMB password.
-; unix password sync = Yes
-# You either need to setup a passwd program and passwd chat, or
-# enable pam password change
-; pam password change = yes
-# passwd program = /usr/bin/passwd %u
-; passwd chat = *New*UNIX*password* %n\n *Re*ype*new*UNIX*password* %n\n \
-;*passwd:*all*authentication*tokens*updated*successfully*
-
-# Unix users can map to different SMB User names
-; username map = /etc/samba/smbusers
-
-# Using the following line enables you to customise your configuration
-# on a per machine basis. The %m gets replaced with the netbios name
-# of the machine that is connecting
-# include = /etc/samba/smb.conf.%m
-
-# Options for using winbind. Winbind allows you to do all account and
-# authentication from a Windows or samba domain controller, creating
-# accounts on the fly, and maintaining a mapping of Windows RIDs to unix uid's
-# and gid's. winbind uid and winbind gid are the only required parameters.
-#
-# winbind uid is the range of uid's winbind can use when mapping RIDs to uid's
-# idmap uid = 10000-20000
-#
-# winbind gid is the range of uid's winbind can use when mapping RIDs to gid's
-# idmap gid = 10000-20000
-#
-# winbind separator is the character a user must use between their domain
-# name and username, defaults to "\"
-# winbind separator = +
-#
-# winbind use default domain allows you to have winbind return usernames
-# in the form user instead of DOMAIN+user for the domain listed in the
-# workgroup parameter.
-# winbind use default domain = yes
-#
-# template homedir determines the home directory for winbind users, with
-# %D expanding to their domain name and %U expanding to their username:
-# template homedir = /home/%D/%U
-
-# When using winbind, you may want to have samba create home directories
-# on the fly for authenticated users. Ensure that /etc/pam.d/samba is
-# using 'service=system-auth-winbind' in pam_stack modules, and then
-# enable obedience of pam restrictions below:
-# obey pam restrictions = yes
-
-#
-# template shell determines the shell users authenticated by winbind get
-# template shell = /bin/bash
-
-# 5. Browser Control and Networking Options:
-# Most people will find that this option gives better performance.
-# See speed.txt and the manual pages for details
- socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
-
-# Configure Samba to use multiple interfaces
-# If you have multiple network interfaces then you must list them
-# here. See the man page for details.
-# interfaces = 192.168.12.2/24 192.168.13.2/24
-
-# Configure remote browse list synchronisation here
-# request announcement to, or browse list sync from:
-# a specific host or from / to a whole subnet (see below)
-# remote browse sync = 192.168.3.25 192.168.5.255
-# Cause this host to announce itself to local subnets here
-# remote announce = 192.168.1.255 192.168.2.44
-
-# set local master to no if you don't want Samba to become a master
-# browser on your network. Otherwise the normal election rules apply
-# local master = no
-
-# OS Level determines the precedence of this server in master browser
-# elections. The default value should be reasonable
-# os level = 33
-
-# Domain Master specifies Samba to be the Domain Master Browser. This
-# allows Samba to collate browse lists between subnets. Don't use this
-# if you already have a Windows NT domain controller doing this job
-# domain master = yes
-
-# Preferred Master causes Samba to force a local browser election on startup
-# and gives it a slightly higher chance of winning the election
-# preferred master = yes
-
-# 6. Domain Control Options:
-# Enable this if you want Samba to be a domain logon server for
-# Windows95 workstations or Primary Domain Controller for WinNT and Win2k
-# domain logons = yes
-
-# if you enable domain logons then you may want a per-machine or
-# per user logon script
-# run a specific logon batch file per workstation (machine)
-# logon script = %m.bat
-# run a specific logon batch file per username
-# logon script = %U.bat
-
-# Where to store roaming profiles for WinNT and Win2k
-# %L substitutes for this servers netbios name, %U is username
-# You must uncomment the [Profiles] share below
-# logon path = \\%L\Profiles\%U
-
-# Where to store roaming profiles for Win9x. Be careful with this as it also
-# impacts where Win2k finds it's /HOME share
-# logon home = \\%L\%U\.profile
-
-
-# The add user script is used by a domain member to add local user accounts
-# that have been authenticated by the domain controller, or when adding
-# users via the Windows NT Tools (ie User Manager for Domains).
-
-# Scripts for file (passwd, smbpasswd) backend:
-# add user script = /usr/sbin/useradd -s /bin/false '%u'
-# delete user script = /usr/sbin/userdel '%s'
-# add user to group script = /usr/bin/gpasswd -a '%u' '%g'
-# delete user from group script = /usr/bin/gpasswd -d '%u' '%g'
-# set primary group script = /usr/sbin/usermod -g '%g' '%u'
-# add group script = /usr/sbin/groupadd %g && getent group '%g'|awk -F: '{print $3}'
-# delete group script = /usr/sbin/groupdel '%g'
-
-# Scripts for LDAP backend (assumes nss_ldap is in use on the domain controller,
-# and needs configuration in smbldap_conf.pm
-# add user script = /usr/share/samba/scripts/smbldap-useradd.pl '%u'
-# delete user script = /usr/share/samba/scripts/smbldap-userdel.pl '%u'
-# add user to group script = /usr/share/samba/scripts/smbldap-groupmod.pl -m '%u' '%g'
-# delete user from group script = /usr/share/samba/scripts/smbldap-groupmod.pl -x '%u' '%g'
-# set primary group script = /usr/share/samba/scripts/smbldap-usermod.pl -g '%g' '%u'
-# add group script = /usr/share/samba/scripts/smbldap-groupadd.pl '%g' && /usr/share/samba/scripts/smbldap-groupshow.pl %g|awk '/^gidNumber:/ {print $2}'
-# delete group script = /usr/share/samba/scripts/smbldap-userdel.pl '%g'
-
-
-# The add machine script is use by a samba server configured as a domain
-# controller to add local machine accounts when adding machines to the domain.
-# The script must work from the command line when replacing the macros,
-# or the operation will fail. Check that groups exist if forcing a group.
-# Script for domain controller for adding machines:
-# add machine script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u
-# Script for domain controller with LDAP backend for adding machines (please
-# configure in /etc/samba/smbldap_conf.pm first):
-# add machine script = /usr/share/samba/scripts/smbldap-useradd.pl -w -d /dev/null -g machines -c 'Machine Account' -s /bin/false %u
-
-# Domain groups:
-# Domain groups are now configured by using the 'net groupmap' tool
-
-# Samba Password Database configuration:
-# Samba now has runtime-configurable password database backends. Multiple
-# passdb backends may be used, but users will only be added to the first one
-# Default:
-# passdb backend = smbpasswd guest
-# TDB backen with fallback to smbpasswd and guest
-# passdb backend = tdbsam smbpasswd guest
-# LDAP with fallback to smbpasswd guest
-# Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below.
-# passdb backend = ldapsam:ldaps://ldap.mydomain.com smbpasswd guest
-# Use the samba2 LDAP schema:
-# passdb backend = ldapsam_compat:ldaps://ldap.mydomain.com smbpasswd guest
-
-# Idmap settings (set idmap uid and idmap gid above):
-# Idmap backend to use:
-# idmap backend = ldap:ldap://ldap.mydomain.com
-
-# LDAP configuration for Domain Controlling:
-# The account (dn) that samba uses to access the LDAP server
-# This account needs to have write access to the LDAP tree
-# You will need to give samba the password for this dn, by
-# running 'smbpasswd -w mypassword'
-# ldap admin dn = cn=root,dc=mydomain,dc=com
-# ldap ssl = start_tls
-# start_tls should run on 389, but samba defaults incorrectly to 636
-# ldap port = 389
-# ldap suffix = dc=mydomain,dc=com
-# Seperate suffixes are available for machines, users, groups, and idmap, if
-# ldap suffix appears first, it is appended to the specific suffix.
-# Example for a unix-ish directory layout:
-# ldap machine suffix = ou=Hosts
-# ldap user suffix = ou=People
-# ldap group suffix = ou=Group
-# ldap idmap suffix = ou=Idmap
-# Example for AD-ish layout:
-# ldap machine suffix = cn=Computers
-# ldap user suffix = cn=Users
-# ldap group suffix = cn=Groups
-# ldap idmap suffix = cn=Idmap
-
-
-# 7. Name Resolution Options:
-# All NetBIOS names must be resolved to IP Addresses
-# 'Name Resolve Order' allows the named resolution mechanism to be specified
-# the default order is "host lmhosts wins bcast". "host" means use the unix
-# system gethostbyname() function call that will use either /etc/hosts OR
-# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
-# and the /etc/resolv.conf file. "host" therefore is system configuration
-# dependant. This parameter is most often of use to prevent DNS lookups
-# in order to resolve NetBIOS names to IP Addresses. Use with care!
-# The example below excludes use of name resolution for machines that are NOT
-# on the local network segment
-# - OR - are not deliberately to be known via lmhosts or via WINS.
-# name resolve order = wins lmhosts bcast
-
-# Windows Internet Name Serving Support Section:
-# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
-# wins support = yes
-
-# WINS Server - Tells the NMBD components of Samba to be a WINS Client
-# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
-# wins server = w.x.y.z
-
-# WINS Proxy - Tells Samba to answer name resolution queries on
-# behalf of a non WINS capable client, for this to work there must be
-# at least one WINS Server on the network. The default is NO.
-# wins proxy = yes
-
-# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
-# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
-# this has been changed in version 1.9.18 to no.
- dns proxy = no
-
-# 8. File Naming Options:
-# Case Preservation can be handy - system default is _no_
-# NOTE: These can be set on a per share basis
-# preserve case = no
-# short preserve case = no
-# Default case is normally upper case for all DOS files
-# default case = lower
-# Be very careful with case sensitivity - it can break things!
-# case sensitive = no
-
-# Enabling internationalization:
-# you can match a Windows code page with a UNIX character set.
-# Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),
-# 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),
-# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean Hangul),
-# 950 (Trad. Chin.).
-# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),
-# ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)
-# This is an example for french users:
-# dos charset = 850
-# unix charset = ISO8859-1
-
-
-#============================ Share Definitions ==============================
-[homes]
- comment = Home Directories
- browseable = no
- writable = yes
-# You can enable VFS recycle bin and on-access virus-scanning on a per
-# share basis:
-# Uncomment the next 2 lines (make sure you create a .recycle folder in
-# the base of the share and ensure all users will have write access to it.
-# For virus scanning, install samba-vscan-clamav and ensure the clamd service
-# is running
-# vfs objects = vscan-clamav recycle
-# vscan-clamav: config-file = /etc/samba/vscan-clamav.conf
-
-# Un-comment the following and create the netlogon directory for Domain Logons
-# [netlogon]
-# comment = Network Logon Service
-# path = /var/lib/samba/netlogon
-# guest ok = yes
-# writable = no
-
-#Uncomment the following 2 lines if you would like your login scripts to
-#be created dynamically by ntlogon (check that you have it in the correct
-#location (the default of the ntlogon rpm available in contribs)
-#root preexec = /usr/bin/ntlogon -u "%U" -g "%G" -o %a -d /var/lib/samba/netlogon/
-#root postexec = rm -f "/var/lib/samba/netlogon/%U.bat"
-
-# Un-comment the following to provide a specific roving profile share
-# the default is to use the user's home directory
-#[Profiles]
-# path = /var/lib/samba/profiles
-# browseable = no
-# guest ok = yes
-# writable = yes
-# This script can be enabled to create profile directories on the fly
-# You may want to turn off guest acces if you enable this, as it
-# hasn't been thoroughly tested.
-#root preexec = PROFILE="/var/lib/samba/profiles/%u"; if [ ! -e $PROFILE ]; \
-# then mkdir -pm700 $PROFILE; chown "%u":"%g" $PROFILE;fi
-# If you want read-only profiles, fake permissions so windows clients think
-# they have written to the files
-# vfs objects = fake_perms
-
-# NOTE: If you have a CUPS print system there is no need to
-# specifically define each individual printer.
-# You must configure the samba printers with the appropriate Windows
-# drivers on your Windows clients or upload the printer driver to the
-# server from Windows (NT/2000/XP). On the Samba server no filtering is
-# done. If you wish that the server provides the driver and the clients
-# send PostScript ("Generic PostScript Printer" under Windows), you have
-# to use 'printcap name = cups' or swap the 'print command' line below
-# with the commented one. Note that print commands only work if not using
-# 'printing=cups'
-[printers]
- comment = All Printers
- path = /var/spool/samba
- browseable = no
-# to allow user 'guest account' to print.
- guest ok = yes
- writable = no
- printable = yes
- create mode = 0700
-# =====================================
-# print command: see above for details.
-# =====================================
- print command = lpr-cups -P %p -o raw %s -r # using client side printer drivers.
-# print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients).
-# If you install drivers on the server, you will want to uncomment this so
-# clients request the driver
- use client driver = yes
-
-# This share is used for Windows NT-style point-and-print support.
-# To be able to install drivers, you need to be either root, or listed
-# in the printer admin parameter above. Note that you also need write access
-# to the directory and share definition to be able to upload the drivers.
-# For more information on this, please see the Printing Support Section of
-# /usr/share/doc/samba-<version>/docs/Samba-HOWTO-Collection.pdf
-#
-# A special case is using the CUPS Windows Postscript driver, which allows
-# all features available via CUPS on the client, by publishing the ppd file
-# and the cups driver by using the 'cupsaddsmb' tool. This requires the
-# installation of the CUPS driver (http://www.cups.org/windows.php)
-# on the server, but doesn't require you to use Windows at all :-).
-[print$]
- path = /var/lib/samba/printers
- browseable = yes
- write list = @adm root
- guest ok = yes
- inherit permissions = yes
- # Settings suitable for Winbind:
- # write list = @"Domain Admins" root
- # force group = +@"Domain Admins"
-
-# A useful application of samba is to make a PDF-generation service
-# To streamline this, install windows postscript drivers (preferably colour)
-# on the samba server, so that clients can automatically install them.
-# Note that this only works if 'printing' is *not* set to 'cups'
-
-[pdf-gen]
- path = /var/tmp
- guest ok = No
- printable = Yes
- comment = PDF Generator (only valid users)
- printing = bsd
- printcap name = cups
- #print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP &
- print command = /usr/share/samba/scripts/print-pdf "%s" "%H" "//%L/%u" "%m" "%I" "%J" &
- lpq command = /bin/true
-
-# This one is useful for people to share files
-;[tmp]
-; comment = Temporary file space
-; path = /tmp
-; read only = no
-; public = yes
-
-# A publicly accessible directory, but read only, except for people in
-# the "staff" group
-;[public]
-; comment = Public Stuff
-; path = /home/samba/public
-; public = yes
-; writable = no
-; write list = @staff
-# Audited directory through experimental VFS audit.so module:
-# Uncomment next line.
-# vfs object = /usr/lib/samba/vfs/audit.so
-
-# Other examples.
-#
-# A private printer, usable only by Fred. Spool data will be placed in Fred's
-# home directory. Note that fred must have write access to the spool directory,
-# wherever it is.
-;[fredsprn]
-; comment = Fred's Printer
-; valid users = fred
-; path = /homes/fred
-; printer = freds_printer
-; public = no
-; writable = no
-; printable = yes
-
-# A private directory, usable only by Fred. Note that Fred requires write
-# access to the directory.
-;[fredsdir]
-; comment = Fred's Service
-; path = /usr/somewhere/private
-; valid users = fred
-; public = no
-; writable = yes
-; printable = no
-
-# a service which has a different directory for each machine that connects
-# this allows you to tailor configurations to incoming machines. You could
-# also use the %u option to tailor it by user name.
-# The %m gets replaced with the machine name that is connecting.
-;[pchome]
-; comment = PC Directories
-; path = /usr/pc/%m
-; public = no
-; writable = yes
-
-# The following two entries demonstrate how to share a directory so that two
-# users can place files there that will be owned by the specific users. In this
-# setup, the directory should be writable by both users and should have the
-# sticky bit set on it to prevent abuse. Obviously this could be extended to
-# as many users as required.
-;[myshare]
-; comment = Mary's and Fred's stuff
-; path = /usr/somewhere/shared
-; valid users = mary fred
-; public = no
-; writable = yes
-; printable = no
-; create mask = 0765
-