From 68a5a224ae6897f898dcfa84e9c2bae06797a666 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 17 May 2019 15:19:06 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20#609=20=E2=80=94=20Handle=20boilerpla?= =?UTF-8?q?te=20db=5Ftype=20conf=20in=20sympa.pl=20--health=5Fcheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sbin/sympa.pl.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sbin/sympa.pl.in b/src/sbin/sympa.pl.in index 6adcea3ff..d0554d706 100644 --- a/src/sbin/sympa.pl.in +++ b/src/sbin/sympa.pl.in @@ -212,10 +212,17 @@ if ($main::options{'upgrade_config_location'}) { $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 + "Database type \"%s\" defined in sympa.conf is the boilerplate one and obviously incorrect. Verify db_xxx parameters in sympa.conf\n", + $Conf::Conf{'db_type'}; + } + ## Check database connectivity and probe database unless (Sympa::DatabaseManager::probe_db()) { die sprintf - "Database %s defined in sympa.conf has not the right structure or is unreachable. verify db_xxx parameters in sympa.conf\n", + "Database %s defined in sympa.conf has not the right structure or is unreachable. Verify db_xxx parameters in sympa.conf\n", $Conf::Conf{'db_name'}; } From 0807b7972e4d9506fbc70bdddb7723cbefcd5a63 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 24 May 2019 09:45:43 +0200 Subject: [PATCH 2/2] =?UTF-8?q?#609=20=E2=80=94=20Check=20db=5Ftype=20conf?= =?UTF-8?q?=20agains=20regex=20in=20sympa.pl=20--health=5Fcheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sbin/sympa.pl.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sbin/sympa.pl.in b/src/sbin/sympa.pl.in index d0554d706..07e28bd76 100644 --- a/src/sbin/sympa.pl.in +++ b/src/sbin/sympa.pl.in @@ -219,6 +219,13 @@ if ($main::options{'upgrade_config_location'}) { $Conf::Conf{'db_type'}; } + ## Preliminary check of db_type + unless ($Conf::Conf{'db_type'} and $Conf::Conf{'db_type'} =~ /\A\w+\z/) { + die sprintf + "Database type \"%s\" defined in sympa.conf seems incorrect. Verify db_xxx parameters in sympa.conf\n", + $Conf::Conf{'db_type'}; + } + ## Check database connectivity and probe database unless (Sympa::DatabaseManager::probe_db()) { die sprintf