You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

376 lines
15 KiB

Index: Makefile.in
--- Makefile.in.orig 2008-03-03 14:06:56 +0100
+++ Makefile.in 2008-03-04 09:44:18 +0100
@@ -714,7 +714,7 @@
@(cd soap && echo "making in soap/..." && \
$(MAKE) SH='${SH}' CC='${CC}' CFLAGS='${CFLAGS}' PERL='${PERL}' \
DIR='${DIR}' BINDIR='${BINDIR}' SBINDIR='${SBINDIR}' LIBDIR='${LIBDIR}' \
- USER='${USER}' GROUP='${GROUP}' SCRIPTDIR='${SCRIPTDIR}' \
+ USER='${USER}' GROUP='${GROUP}' SCRIPTDIR='${SCRIPTDIR}' enable_secure='${enable_secure}' \
CGIDIR='${CGIDIR}' WWSBINDIR='${WWSBINDIR}' MAILERPROGDIR='${MAILERPROGDIR}' \
PIDDIR='${PIDDIR}' CONFIG='${CONFIG}' WWSCONFIG='${WWSCONFIG}' ETCBINDIR='${ETCBINDIR}' \
DESTDIR='${DESTDIR}' USER='${USER}' GROUP='${GROUP}' newinstall) || exit 1;
Index: soap/Makefile
--- soap/Makefile.orig 2007-12-05 16:37:14 +0100
+++ soap/Makefile 2008-03-04 09:45:41 +0100
@@ -60,9 +60,11 @@
chown $(USER) $(DESTDIR)$(CGIDIR)/$$i; \
chgrp $(GROUP) $(DESTDIR)$(CGIDIR)/$$i; \
done
+ @if [ "$(enable_secure)" != "yes" ]; then \
@echo "Setting SetUID bit on sympa_soap_server-wrapper.fcgi..."
chmod u+s $(DESTDIR)$(CGIDIR)/sympa_soap_server-wrapper.fcgi
chmod g+s $(DESTDIR)$(CGIDIR)/sympa_soap_server-wrapper.fcgi
+ fi
@for i in $(lib_SUBST) ; do \
chown $(USER) $(DESTDIR)$(LIBDIR)/$$i; \
chgrp $(GROUP) $(DESTDIR)$(LIBDIR)/$$i; \
Index: soap/sympa_soap_server.fcgi
--- soap/sympa_soap_server.fcgi.orig 2007-12-13 16:42:04 +0100
+++ soap/sympa_soap_server.fcgi 2008-03-04 09:44:18 +0100
@@ -52,7 +52,7 @@
## Open log
$wwsconf->{'log_facility'}||= $Conf{'syslog'};
-&Log::do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'soap');
+&Log::do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'soap', $Conf{'logfile'});
&Log::do_log('info', 'SOAP server launched');
unless ($List::use_db = &List::check_db_connect()) {
Index: src/Conf.pm
--- src/Conf.pm.orig 2008-02-13 14:15:20 +0100
+++ src/Conf.pm 2008-03-04 09:47:05 +0100
@@ -50,7 +50,7 @@
cookie cookie_cas_expire create_list automatic_list_feature automatic_list_creation automatic_list_removal crl_dir crl_update_task db_host db_env db_name db_timeout
db_options db_passwd db_type db_user db_port db_additional_subscriber_fields db_additional_user_fields
default_shared_quota default_archive_quota default_list_priority distribution_mode edit_list email etc
- global_remind home host ignore_x_no_archive_header_feature domain lang listmaster listmaster_email localedir log_socket_type log_level
+ global_remind home host ignore_x_no_archive_header_feature domain lang listmaster listmaster_email localedir log_socket_type log_level logfile
logo_html_definition
main_menu_custom_button_1_title main_menu_custom_button_1_url main_menu_custom_button_1_target
main_menu_custom_button_2_title main_menu_custom_button_2_url main_menu_custom_button_2_target
@@ -110,6 +110,7 @@
'host' => undef,
'domain' => undef,
'email' => 'sympa',
+ 'logfile' => '--PIDDIR--/sympa.log',
'pidfile' => '--PIDDIR--/sympa.pid',
'pidfile_distribute' => '--PIDDIR--/sympa-distribute.pid',
'pidfile_creation' => '--PIDDIR--/sympa-creation.pid',
Index: src/Language.pm
--- src/Language.pm.orig 2008-01-07 14:05:19 +0100
+++ src/Language.pm 2008-03-04 09:44:18 +0100
@@ -176,7 +176,7 @@
}
}
unless ($success) {
- &do_log('err','Failed to setlocale(%s) ; you either have a problem with the catalogue .mo files or you should extend available locales in your /etc/locale.gen (or /etc/sysconfig/i18n) file', $locale);
+ # &do_log('err','Failed to setlocale(%s) ; you either have a problem with the catalogue .mo files or you should extend available locales in your /etc/locale.gen (or /etc/sysconfig/i18n) file', $locale);
return undef;
}
}
Index: src/Log.pm
--- src/Log.pm.orig 2007-12-19 16:22:54 +0100
+++ src/Log.pm 2008-03-04 09:49:54 +0100
@@ -26,7 +26,7 @@
use strict "vars";
require Exporter;
-use Sys::Syslog;
+use IO::File;
use Carp;
use POSIX qw/mktime/;
use Encode;
@@ -34,6 +34,7 @@
our @ISA = qw(Exporter);
our @EXPORT = qw(fatal_err do_log do_openlog $log_level);
+my ($log_fh, $log_file);
my ($log_facility, $log_socket_type, $log_service,$sth,@sth_stack,$rows_nb);
# When logs are not available, period of time to wait before sending another warning to listmaster.
my $warning_timeout = 600;
@@ -47,8 +48,7 @@
my $errno = $!;
eval {
- syslog('err', $m, @_);
- syslog('err', "Exiting.");
+ 1;
};
if($@ && ($warning_date < time - $warning_timeout)) {
$warning_date = time + $warning_timeout;
@@ -108,9 +108,9 @@
$fac = 'notice';
}
eval {
- unless (syslog($fac, $m, @param)) {
+ unless (&do_write($fac, $level, $m, @param)) {
&do_connect();
- syslog($fac, $m, @param);
+ &do_write($fac, $level, $m, @param);
}
};
if($@ && ($warning_date < time - $warning_timeout)) {
@@ -128,12 +128,24 @@
}
}
+sub do_write {
+ my ($fac, $level, $fmt, @args) = @_;
+ if (defined($log_fh)) {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
+ my $date = sprintf("%b %2d %02d:%02d:%02d", $mon+1, $mday, $hour, $min, $sec);
+ $log_fh->printf("%s %s[%d]: [%s.%s] $fmt\n", $date, $log_service, $$, $fac, $level, @args);
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
sub do_openlog {
- my ($fac, $socket_type, $service) = @_;
+ my ($fac, $socket_type, $service, $logfile) = @_;
$service ||= 'sympa';
- ($log_facility, $log_socket_type, $log_service) = ($fac, $socket_type, $service);
+ ($log_facility, $log_socket_type, $log_service, $log_file) = ($fac, $socket_type, $service, $logfile);
# foreach my $k (keys %options) {
# printf "%s = %s\n", $k, $options{$k};
@@ -143,18 +155,8 @@
}
sub do_connect {
- if ($log_socket_type =~ /^(unix|inet)$/i) {
- Sys::Syslog::setlogsock(lc($log_socket_type));
- }
- # close log may be usefull : if parent processus did open log child process inherit the openlog with parameters from parent process
- closelog ;
- eval {openlog("$log_service\[$$\]", 'ndelay', $log_facility)};
- if($@ && ($warning_date < time - $warning_timeout)) {
- $warning_date = time + $warning_timeout;
- unless(&List::send_notify_to_listmaster('logs_failed', $Conf::Conf{'host'}, [$@])) {
- print STDERR "No logs available, can't send warning message";
- }
- };
+ $log_fh->close() if defined($log_fh);
+ $log_fh = new IO::File ">>$log_file";
}
# return the name of the used daemon
Index: src/alias_manager.pl
--- src/alias_manager.pl.orig 2007-12-13 11:54:45 +0100
+++ src/alias_manager.pl 2008-03-04 09:44:18 +0100
@@ -45,7 +45,7 @@
my $tmp_alias_file = $Conf{'tmpdir'}.'/sympa_aliases.'.time;
-my $alias_wrapper = '--MAILERPROGDIR--/aliaswrapper';
+my $alias_wrapper = '--LIBEXECDIR--/aliaswrapper';
my $lock_file = '--EXPL_DIR--/alias_manager.lock';
my $default_domain;
my $path_to_queue = '--MAILERPROGDIR--/queue';
Index: src/etc/script/mod2html.pl
--- src/etc/script/mod2html.pl.orig 2007-06-26 15:20:24 +0200
+++ src/etc/script/mod2html.pl 2008-03-04 09:44:18 +0100
@@ -12,7 +12,7 @@
unless (Conf::load('--CONFIG--')) {
die "Can't load Sympa configuration file";
}
-&do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa');
+&do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa', $Conf{'logfile'});
if ($Conf{'db_name'} and $Conf{'db_type'}) {
unless (&Upgrade::probe_db()) {
Index: src/etc/script/testlogs.pl
--- src/etc/script/testlogs.pl.orig 2007-07-31 16:47:41 +0200
+++ src/etc/script/testlogs.pl 2008-03-04 09:44:18 +0100
@@ -19,7 +19,7 @@
## Open the syslog and say we're read out stuff.
-do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa');
+do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa', $Conf{'logfile'});
# setting log_level using conf unless it is set by calling option
if ($main::options{'log_level'}) {
Index: src/sympa.pl
--- src/sympa.pl.orig 2008-01-18 15:06:26 +0100
+++ src/sympa.pl 2008-03-04 09:44:18 +0100
@@ -173,7 +173,7 @@
}
## Open the syslog and say we're read out stuff.
-do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa');
+do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa', $Conf{'logfile'});
# setting log_level using conf unless it is set by calling option
if ($main::options{'log_level'}) {
@@ -314,7 +314,7 @@
$service .= '(distribute)' if ($main::daemon_usage == DAEMON_MESSAGE);
$service .= '(command)' if ($main::daemon_usage == DAEMON_COMMAND);
$service .= '(creation)' if ($main::daemon_usage == DAEMON_CREATION);
- do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, $service);
+ do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, $service, $Conf{'logfile'});
do_log('debug', "Running server $$ for $service purpose ");
unless ($main::options{'batch'} ) {
Index: src/sympa_wizard.pl
--- src/sympa_wizard.pl.orig 2008-01-30 18:28:31 +0100
+++ src/sympa_wizard.pl 2008-03-04 09:44:18 +0100
@@ -65,6 +65,12 @@
'query' => 'Directory for configuration files ; it also contains scenari/ and templates/ directories',
'file' => 'sympa.conf'},
+ {'name' => 'logfile',
+ 'default' => '--PIDDIR--/sympa.log',
+ 'query' => 'File to which Sympa logs.',
+ 'file' => 'sympa.conf',
+ 'advice' =>'Sympa logs to this file instead of Syslog.'},
+
{'name' => 'pidfile',
'default' => '--PIDDIR--/sympa.pid',
'query' => 'File containing Sympa PID while running.',
@@ -92,13 +98,13 @@
'advice' =>''},
{'name' => 'arc_path',
- 'default' => '--DIR--/arc',
+ 'default' => '--DIR--/var/sympa/store/arc',
'query' => 'Where to store HTML archives',
'file' => 'wwsympa.conf','edit' => '1',
'advice' =>'Better if not in a critical partition'},
{'name' => 'bounce_path',
- 'default' => '--DIR--/bounce',
+ 'default' => '--DIR--/var/sympa/store/bounce',
'query' => 'Where to store bounces',
'file' => 'wwsympa.conf',
'advice' =>'Better if not in a critical partition'},
@@ -166,13 +172,13 @@
{'title' => 'General definition'},
{'name' => 'domain',
- 'default' => '--HOST--',
+ 'default' => 'example.com',
'query' => 'Main robot hostname',
'file' => 'sympa.conf',
'advice' =>''},
{'name' => 'listmaster',
- 'default' => 'your_email_address@--HOST--',
+ 'default' => 'listmaster@example.com',
'query' => 'Listmasters email list comma separated',
'file' => 'sympa.conf','edit' => '1',
'advice' =>'Sympa will associate listmaster privileges to these email addresses (mail and web interfaces). Some error reports may also be sent to these addresses.'},
@@ -300,7 +306,7 @@
{'title' => 'MTA related'},
{'name' => 'sendmail',
- 'default' => '/usr/sbin/sendmail',
+ 'default' => '--DIR--/sbin/sendmail',
'query' => 'Path to the MTA (sendmail, postfix, exim or qmail)',
'file' => 'sympa.conf','edit' => '1',
'advice' => "should point to a sendmail-compatible binary (eg: a binary named \'sendmail\' is distributed with Postfix)"},
@@ -327,7 +333,7 @@
{'title' => 'Pluggin'},
{'name' => 'antivirus_path',
- 'sample' => '/usr/local/uvscan/uvscan',
+ 'sample' => '--DIR--/bin/uvscan',
'query' => 'Path to the antivirus scanner engine',
'file' => 'sympa.conf','edit' => '1',
'advice' =>'supported antivirus : McAfee/uvscan, Fsecure/fsav, Sophos, AVP and Trend Micro/VirusWall'},
@@ -340,14 +346,14 @@
'advice' =>''},
{'name' => 'mhonarc',
- 'default' => '/usr/bin/mhonarc',
+ 'default' => '--DIR--/bin/mhonarc',
'query' => 'Path to MhOnarc mail2html pluggin',
'file' => 'wwsympa.conf','edit' => '1',
'advice' =>'This is required for HTML mail archiving'},
{'title' => 'S/MIME pluggin'},
{'name' => 'openssl',
- 'sample' => '/usr/local/bin/openssl',
+ 'sample' => '--DIR--/bin/openssl',
'query' => 'Path to OpenSSL',
'file' => 'sympa.conf','edit' => '1',
'advice' =>'Sympa knowns S/MIME if openssl is installed'},
@@ -368,7 +374,7 @@
'file' => 'sympa.conf'},
{'name' => 'key_passwd',
- 'sample' => 'your_password',
+ 'sample' => 'sympa',
'query' => 'Password used to crypt lists private keys',
'file' => 'sympa.conf','edit' => '1',
'advice' =>''},
@@ -405,7 +411,7 @@
'advice' =>''},
{'name' => 'db_passwd',
- 'sample' => 'your_passwd',
+ 'sample' => 'sympa',
'query' => 'Database password (associated to the db_user)',
'file' => 'sympa.conf','edit' => '1',
'advice' =>'What ever you use a password or not, you must protect the SQL server (is it a not a public internet service ?)'},
@@ -436,7 +442,7 @@
'advice' =>'This module provide much faster web interface'},
{'name' => 'wwsympa_url',
- 'default' => 'http://--HOST--/sympa',
+ 'default' => 'http://www.example.com/sympa',
'query' => "Sympa\'s main page URL",
'file' => 'sympa.conf','edit' => '1',
'advice' =>''},
Index: src/task_manager.pl
--- src/task_manager.pl.orig 2007-12-14 16:12:21 +0100
+++ src/task_manager.pl 2008-03-04 09:44:18 +0100
@@ -114,7 +114,7 @@
&tools::write_pid($wwsconf->{'task_manager_pidfile'}, $$);
$wwsconf->{'log_facility'}||= $Conf{'syslog'};
-do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'task_manager');
+do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'task_manager', $Conf{'logfile'});
# setting log_level using conf unless it is set by calling option
if ($main::options{'log_level'}) {
Index: wwsympa/archived.pl
--- wwsympa/archived.pl.orig 2007-12-11 16:49:30 +0100
+++ wwsympa/archived.pl 2008-03-04 09:44:18 +0100
@@ -132,7 +132,7 @@
}
$wwsconf->{'log_facility'}||= $Conf{'syslog'};
-do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'archived');
+do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'archived', $Conf{'logfile'});
## Set the UserID & GroupID for the process
$( = $) = (getgrnam('--GROUP--'))[2];
Index: wwsympa/bounced.pl
--- wwsympa/bounced.pl.orig 2007-12-13 14:33:38 +0100
+++ wwsympa/bounced.pl 2008-03-04 09:44:18 +0100
@@ -147,7 +147,7 @@
}
$wwsconf->{'log_facility'}||= $Conf{'syslog'};
-do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'bounced');
+do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'bounced', $Conf{'logfile'});
## Set the UserID & GroupID for the process
$( = $) = (getgrnam('--GROUP--'))[2];
Index: wwsympa/wwsympa.fcgi
--- wwsympa/wwsympa.fcgi.orig 2008-02-29 12:34:07 +0100
+++ wwsympa/wwsympa.fcgi 2008-03-04 09:44:18 +0100
@@ -617,7 +617,7 @@
## Open log
$wwsconf->{'log_facility'}||= $Conf{'syslog'};
-&Log::do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'wwsympa');
+&Log::do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'wwsympa', $Conf{'logfile'});
&do_log('info', 'WWSympa started');
## Set locale configuration