Commit b54f1fd2 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Don't track changes of obsoleted parameter "cookie".

parent 9bbe94fd
......@@ -1023,11 +1023,6 @@ unless (Conf::data_structure_uptodate()) {
$maintenance_mode = 1;
$log->syslog('err',
'WWSympa set to maintenance mode; you should run sympa.pl --upgrade');
} elsif (Conf::cookie_changed()) {
$maintenance_mode = 1;
$log->syslog('err',
'WWSympa set to maintenance mode; sympa.conf/cookie parameter has changed.'
);
}
 
our %in;
......@@ -1096,7 +1091,6 @@ while ($query = Sympa::WWW::FastCGI->new) {
## If in maintenance mode, check if the data structure is now uptodate
if ( $maintenance_mode
and Conf::data_structure_uptodate()
and not Conf::cookie_changed()
and ($EUID eq (getpwnam(Sympa::Constants::USER))[2])) {
$maintenance_mode = undef;
$log->syslog('notice',
......
......@@ -705,45 +705,8 @@ sub data_structure_uptodate {
# Check if cookie parameter was changed.
# Old name: tools::cookie_changed().
sub cookie_changed {
my $current = $Conf::Conf{'cookie'};
$current = '' unless defined $current;
my $changed = 1;
if (-f "$Conf::Conf{'etc'}/cookies.history") {
my $fh;
unless (open $fh, "$Conf::Conf{'etc'}/cookies.history") {
$log->syslog('err', 'Unable to read %s/cookies.history',
$Conf::Conf{'etc'});
return undef;
}
my $oldcook = <$fh>;
close $fh;
($oldcook) = reverse split /\s+/, $oldcook;
$oldcook = '' unless defined $oldcook;
if ($oldcook eq $current) {
$log->syslog('debug2', 'Cookie is stable');
$changed = 0;
}
return $changed;
} else {
my $umask = umask 037;
unless (open COOK, ">$Conf::Conf{'etc'}/cookies.history") {
umask $umask;
$log->syslog('err', 'Unable to create %s/cookies.history',
$Conf::Conf{'etc'});
return undef;
}
umask $umask;
chown [getpwnam(Sympa::Constants::USER)]->[2],
[getgrnam(Sympa::Constants::GROUP)]->[2],
"$Conf::Conf{'etc'}/cookies.history";
print COOK "$current ";
close COOK;
return (0);
}
}
# Deprecated: No longer used.
#sub cookie_changed;
## Check a few files
sub checkfiles {
......
......@@ -208,12 +208,6 @@ if ($main::options{'upgrade_config_location'}) {
);
}
if (Conf::cookie_changed()) {
die sprintf
'sympa.conf/cookie parameter has changed. You may have severe inconsitencies into password storage. Restore previous cookie or write some tool to re-encrypt password in database and check spools contents (look at %s/cookies.history file).',
$Conf::Conf{'etc'};
}
## Check if db_type is not the boilerplate one
if ($Conf::Conf{'db_type'} eq '(You must define this parameter)') {
die sprintf
......@@ -1134,12 +1128,6 @@ sub _load {
);
}
if (Conf::cookie_changed()) {
die sprintf
'sympa.conf/cookie parameter has changed. You may have severe inconsitencies into password storage. Restore previous cookie or write some tool to re-encrypt password in database and check spools contents (look at %s/cookies.history file).',
$Conf::Conf{'etc'};
}
# Check database connectivity.
unless (Sympa::DatabaseManager->instance) {
die sprintf
......
......@@ -227,12 +227,6 @@ sub _load {
);
}
if (Conf::cookie_changed()) {
die sprintf
'sympa.conf/cookie parameter has changed. You may have severe inconsitencies into password storage. Restore previous cookie or write some tool to re-encrypt password in database and check spools contents (look at %s/cookies.history file).',
$Conf::Conf{'etc'};
}
# Check database connectivity.
unless (Sympa::DatabaseManager->instance) {
die sprintf
......
......@@ -307,12 +307,6 @@ sub _load {
);
}
if (Conf::cookie_changed()) {
die sprintf
'sympa.conf/cookie parameter has changed. You may have severe inconsitencies into password storage. Restore previous cookie or write some tool to re-encrypt password in database and check spools contents (look at %s/cookies.history file).',
$Conf::Conf{'etc'};
}
# Check database connectivity.
unless (Sympa::DatabaseManager->instance) {
die sprintf
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment