From 83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Tue, 15 Oct 2002 16:10:00 +0000 Subject: wiz update, nfs fixed --- ftp_wizard/ftp.wiz | 76 ++++++++++++++++++++++++++++++++++++++-- ftp_wizard/scripts/ProFtpconf.pm | 49 ++++++++++++++++++++++---- 2 files changed, 115 insertions(+), 10 deletions(-) (limited to 'ftp_wizard') diff --git a/ftp_wizard/ftp.wiz b/ftp_wizard/ftp.wiz index 12e6b9f9..63ad0024 100644 --- a/ftp_wizard/ftp.wiz +++ b/ftp_wizard/ftp.wiz @@ -9,6 +9,7 @@ defaultImage="__WIZ_HOME__/ftp_wizard/images/FTP" perlModule="__WIZ_HOME__/ftp_wizard/scripts/ProFtpconf.pm" rpm="proftpd" + summaryFunc="do_it" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + ) { # we need 3 elements to consider section as known + if (m/^\s*/s...m/^\s*<\/drakwizard>/s ) { + if (m/^\s*/s ) { + return $1; + } + } + } + ""; +} + my $o = DrakconnectConf->new(); sub check { @@ -23,6 +39,23 @@ sub check { 0; } +sub print_anonymous() { + print ' +# + + User ftp + Group ftp + UserAlias anonymous ftp + MaxClients 10 + + DenyAll + + +# +'; +EOF +} + sub do_it { my $wiz_ftp_internal = $ENV{wiz_ftp_external} ? 1 : true $ENV{wiz_ftp_internal}; my $wiz_ftp_external = true $ENV{wiz_ftp_external}; @@ -41,23 +74,23 @@ sub do_it { my $file = "/etc/proftpd.conf"; open (NEW, "< $file"); my $exist = 0; - while () { + while () { # we need 3 elements to consider section as known if (m/^\s*/s...m/^\s*<\/Global>/s ) { if (m/^\s*/s...m/^\s*<\/Limit>/s ) { if (/^\s*(?!\#)\s*Order .*$/) { - $exist += 1; + $exist++; } if (/^\s*(?!\#)\s*Allow .*$/) { - $exist += 1; + $exist++; } if (/^\s*(?!\#)\s*Deny .*$/) { - $exist += 1; + $exist++; } } } } close (NEW); - if ($exist < 3) { + if ($exist < 3) { # Odd parameters are commented if exists to then add a known section substInFile { if (m/^\s*/s...m/^\s*<\/Global>/s ) { if (m/^\s*/s...m/^\s*<\/Limit>/s ) { @@ -69,16 +102,18 @@ sub do_it { } $file; open (NEW, ">> $file"); print NEW ' +# Order allow,deny Allow from '.$allow.' Deny from all -'; + +#'; close NEW; } - else { + else { # the known section (3 parameters ) is replaced with our needs substInFile { if (m/^\s*/s...m/^\s*<\/Global>/s ) { if (m/^\s*/s...m/^\s*<\/Limit>/s ) { -- cgit v1.2.1