You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by pa...@apache.org on 2004/06/19 06:38:53 UTC
svn commit: rev 21439 - in incubator/spamassassin/trunk: . spamd
Author: parker
Date: Fri Jun 18 21:38:53 2004
New Revision: 21439
Modified:
incubator/spamassassin/trunk/INSTALL
incubator/spamassassin/trunk/spamd/spamd.raw
Log:
Bug 3503: config needs to be copied for sql/ldap configs as well
Modified: incubator/spamassassin/trunk/INSTALL
==============================================================================
--- incubator/spamassassin/trunk/INSTALL (original)
+++ incubator/spamassassin/trunk/INSTALL Fri Jun 18 21:38:53 2004
@@ -209,7 +209,8 @@
- Storable (from CPAN)
This is a required module if you use spamd, and allow user
- configurations to be used (ie: you don't use "-x" or "-u").
+ configurations to be used (ie: you don't use -x, -u, -q/--sql-config,
+ -Q/--setuid-with-sql, --ldap-config, or --setuid-with-ldap).
Optional Additional Modules
Modified: incubator/spamassassin/trunk/spamd/spamd.raw
==============================================================================
--- incubator/spamassassin/trunk/spamd/spamd.raw (original)
+++ incubator/spamassassin/trunk/spamd/spamd.raw Fri Jun 18 21:38:53 2004
@@ -465,6 +465,8 @@
(!$opt{'user-config'} && !($opt{'setuid-with-sql'}||$opt{'setuid-with-ldap'}))
) ? 0 : 1;
+my $copy_config_p = $setuid_to_user || $opt{'sql-config'} || $opt{'ldap-config'};
+
my $current_user;
my $client; # used for the client connection ...
@@ -696,7 +698,7 @@
# If we need Storable, and it's not installed, alert now before we daemonize.
die "Required module Storable not found!\n"
- if ($setuid_to_user && !$spamtest->_is_storable_available());
+ if ($copy_config_p && !$spamtest->_is_storable_available());
## DAEMONIZE! ##
@@ -714,8 +716,15 @@
# the M::SA creation.
my %conf_backup = ();
my %msa_backup = ();
+
# if $clients_per_child == 1, there's no point in copying configs around
-if ($setuid_to_user && $clients_per_child > 1) {
+unless ($clients_per_child > 1) {
+ # unset $copy_config_p so we don't bother trying to copy things back
+ # after closing the connection
+ $copy_config_p = 0;
+}
+
+if ($copy_config_p) {
foreach( 'username', 'user_dir', 'userstate_dir' ) {
$msa_backup{$_} = $spamtest->{$_} if (exists $spamtest->{$_});
}
@@ -849,7 +858,9 @@
logmsg("fatal: return setuid failed");
die; # make it fatal to avoid security breaches
}
+ }
+ if ($copy_config_p) {
while(my($k,$v) = each %msa_backup) {
$spamtest->{$k} = $v;
}