From 58ae7bb3422ab92a0ec589ed53e94ceb2420e7c5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 7 Jun 2020 11:57:20 -0400 Subject: [PATCH] die early if db connection fails --- scripts/zmupdate.pl.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in index 895e8bd64..619527128 100644 --- a/scripts/zmupdate.pl.in +++ b/scripts/zmupdate.pl.in @@ -119,6 +119,9 @@ GetOptions( ) or pod2usage(-exitstatus => -1); my $dbh = zmDbConnect(undef, { mysql_multi_statements=>1 } ); +if ( !$dbh ) { + die "Unable to connect to db\n"; +} $Config{ZM_DB_USER} = $dbUser; $Config{ZM_DB_PASS} = $dbPass; # we escape dbpass with single quotes so that $ in the password has no effect, but dbpass could have a ' in it.