summaryrefslogtreecommitdiffstats
path: root/nfs_wizard
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 /nfs_wizard
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
Diffstat (limited to 'nfs_wizard')
-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
7 files changed, 0 insertions, 590 deletions
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
-
-
-