summaryrefslogtreecommitdiffstats
path: root/ftp_wizard
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-09-05 07:38:54 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-09-05 07:38:54 +0000
commit98dcb4c3c0e912b83639b79cf9a37b392119ac01 (patch)
treea4567a9165e80471ab4eebec2cee47f028cac215 /ftp_wizard
parentf7cca6ea32444a7764d54989bf360530d07d6092 (diff)
downloaddrakwizard-98dcb4c3c0e912b83639b79cf9a37b392119ac01.tar
drakwizard-98dcb4c3c0e912b83639b79cf9a37b392119ac01.tar.gz
drakwizard-98dcb4c3c0e912b83639b79cf9a37b392119ac01.tar.bz2
drakwizard-98dcb4c3c0e912b83639b79cf9a37b392119ac01.tar.xz
drakwizard-98dcb4c3c0e912b83639b79cf9a37b392119ac01.zip
removed - we now use ProFtpd
Diffstat (limited to 'ftp_wizard')
-rw-r--r--ftp_wizard/scripts/Ftpconf.pm75
1 files changed, 0 insertions, 75 deletions
diff --git a/ftp_wizard/scripts/Ftpconf.pm b/ftp_wizard/scripts/Ftpconf.pm
deleted file mode 100644
index 92473579..00000000
--- a/ftp_wizard/scripts/Ftpconf.pm
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/perl
-
-# Proftpd Config Parser
-
-# 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 Ftpconf;
-require "__WIZ_HOME__/common/scripts/Vareqval.pm";
-use MDK::Common;
-use strict;
-
-sub true_or_false {
- my ($val) = @_;
-
- $val eq "0" || $val eq "\'0\'" || $val eq "\"0\"" ||
- $val eq "false" || $val eq "\'false\'" || $val eq "\"false\"" and
- return 0;
- $val eq "1" || $val eq "\'1\'" || $val eq "\"1\"" ||
- $val eq "true" || $val eq "\'true\'" || $val eq "\"true\"" and
- return 1;
- 0;
-}
-
-sub do_it {
- my %mdk = Vareqval->get("/etc/sysconfig/mdk_serv");
- $mdk{wiz_ftp_external} = $ENV{wiz_ftp_external} if defined $ENV{wiz_ftp_external} or
- die "wiz_ftp_external not defined in env !";
- $mdk{wiz_ftp_internal} = $ENV{wiz_ftp_internal} if defined $ENV{wiz_ftp_internal} or
- die "wiz_ftp_internal not defined in env !";
- $mdk{wiz_ftp_external} = true_or_false($mdk{wiz_ftp_external});
- $mdk{wiz_ftp_internal} = $mdk{wiz_ftp_external} ? 1 : true_or_false($mdk{wiz_ftp_internal});
- my $wiz_ftp_internal = $mdk{wiz_ftp_internal};
- my $wiz_ftp_external = $mdk{wiz_ftp_external};
- my $wiz_device = $mdk{wiz_device} if defined $mdk{wiz_device} or
- die "wiz_device not in /etc/sysconfig/mdk_serv";
- Vareqval->commit("/etc/sysconfig/mdk_serv", \%mdk);
-
- my $file = "/etc/ftphosts";
- die "no ftp configuration file found ! warning." if (!-f $file);
- MDK::Common::cp_af($file, $file . ".orig");
- open(NEW, "> $file") or die "error while opening $file: $!";
- my $date = `date`;
- print NEW "# host access file
-# Everything after a '#' is treated as comment,
-# empty lines are ignored
-# acces allowed without host restriction done
-# by script $date\n";
- if ($wiz_ftp_internal && !$wiz_ftp_external) {
- my %mdk = Vareqval->get("/etc/sysconfig/network-scripts/ifcfg-".$wiz_device);
- my $wiz_ip_net = $mdk{NETWORK} if defined $mdk{NETWORK} or
- die "NETWORK not in /etc/sysconfig/network-scripts/ifcfg-".$wiz_device;
- ($wiz_ip_net) = ($wiz_ip_net =~ /(.*)\..*/);
- print NEW "allow * $wiz_ip_net.*\n";
- }
- elsif (!$wiz_ftp_external) {
- print NEW "deny * *\n";
- }
-
- system("service xinetd restart");
-}
-