summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2004-01-13 15:31:02 +0000
committerAntoine Ginies <aginies@mandriva.com>2004-01-13 15:31:02 +0000
commit6f059fa388e04edc0094f3a1d5da02b0d837a20e (patch)
tree961d1cabe1bf713fdc854060549537a825f40741
parentb20391657fbcffc38b35acc1ca09041a92e52905 (diff)
downloaddrakwizard-6f059fa388e04edc0094f3a1d5da02b0d837a20e.tar
drakwizard-6f059fa388e04edc0094f3a1d5da02b0d837a20e.tar.gz
drakwizard-6f059fa388e04edc0094f3a1d5da02b0d837a20e.tar.bz2
drakwizard-6f059fa388e04edc0094f3a1d5da02b0d837a20e.tar.xz
drakwizard-6f059fa388e04edc0094f3a1d5da02b0d837a20e.zip
put default option in configuration file
-rwxr-xr-xftp_wizard/Proftpd.pm40
-rw-r--r--ftp_wizard/scripts/proftpd.conf.default6
2 files changed, 41 insertions, 5 deletions
diff --git a/ftp_wizard/Proftpd.pm b/ftp_wizard/Proftpd.pm
index ad42e864..ca8a466b 100755
--- a/ftp_wizard/Proftpd.pm
+++ b/ftp_wizard/Proftpd.pm
@@ -46,6 +46,27 @@ my $o = {
defaultimage => "$ENV{__WIZ_HOME__}ftp_wizard/images/FTP.png"
};
+my %opt = (
+ "SystemLog" => "/var/log/proftpd/proftpd.log",
+ "TransferLog" => "/var/log/proftpd/xferlog",
+ "Extendedlog" => "/var/log/proftpd/ftp.log",
+ "LogFormat default" => "\"%h %l %u %t \"%r\" %s %b\"",
+ "LogFormat auth" => "\"%v [%P] %h %t \"%r\" %s\"",
+ "LogFormat write" => "\"%h %l %u %t \"%r\" %s %b\"",
+ "ServerIdent" => "off",
+ "DeferWelcome" => "on",
+ "DisplayConnect" => "/etc/banner-proftpd",
+ "AccessDenyMsg" => "\" !-!! ACCESS DENY !!-! SEEMS YOU HAVE NO RIGHT THERE !!\"",
+ "AccessGrantMsg" => "\" -- Guest access granted for %u --\"",
+ "IdentLookups" => "off",
+ "UseReverseDNS" => "off",
+ "TimesGMT" => "off",
+ "DirFakeUser" => "off nobody",
+ "DirFakeGroup" => "off nobody",
+ "DeleteAbortedStores" => "off",
+ "PersistentPasswd" => "off",
+ );
+
$o->{pages} = {
welcome => {
name => N("FTP Server Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the FTP Server for your network."),
@@ -185,7 +206,6 @@ sub change_options {
my ($var, $var_in_conf) = @_;
my $file = "/etc/proftpd.conf";
my $status;
- print "now in change options\n";
if ($var == 1) { $status = "on" } else { $status = "off" }
if ( any { /^$var_in_conf/ } cat_($file)) {
substInFile { s/$var_in_conf.*/$var_in_conf $status/ } $file;
@@ -194,6 +214,17 @@ sub change_options {
}
}
+sub add_options {
+ my ($var, $value) = @_;
+ my $file = "/etc/proftpd.conf";
+ if ( any { /^$var/ } cat_($file)) {
+ substInFile { s/$var.*/$var $value/ } $file;
+ } else {
+ append_to_file($file, "$var $value\n")
+ }
+}
+
+
sub do_it {
$::testing and return;
my $wiz_ftp_internal = $o->{var}{wiz_ftp_external} ? 1 : true $o->{var}{wiz_ftp_internal};
@@ -303,7 +334,12 @@ sub do_it {
substInFile { s/DefaultRoot.*/$data/ } $file;
} else {
append_to_file($file, "$data\n");
- }
+ }
+
+ my $cle, my $val;
+ while (($cle, $val) = each %opt) {
+ add_options($cle, $val);
+ }
if (services::is_service_running('proftpd')) {
services::restart('proftpd')
diff --git a/ftp_wizard/scripts/proftpd.conf.default b/ftp_wizard/scripts/proftpd.conf.default
index 0dc72bb1..85443025 100644
--- a/ftp_wizard/scripts/proftpd.conf.default
+++ b/ftp_wizard/scripts/proftpd.conf.default
@@ -84,9 +84,9 @@ DeleteAbortedStores off
#TransferRate STOR,APPE 100
# Some logging formats
-SystemLog /var/log/proftpd.log
-TransferLog /var/log/xferlog
-Extendedlog /var/log/ftp.log
+SystemLog /var/log/proftpd/proftpd.log
+TransferLog /var/log/proftpd/xferlog
+Extendedlog /var/log/proftpd/ftp.log
LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth "%v [%P] %h %t \"%r\" %s"
LogFormat write "%h %l %u %t \"%r\" %s %b"