Harden the rules for GTM control file structure
authorPavan Deolasee <pavan.deolasee@gmail.com>
Tue, 9 Oct 2018 06:43:17 +0000 (12:13 +0530)
committerPavan Deolasee <pavan.deolasee@gmail.com>
Tue, 9 Oct 2018 06:43:17 +0000 (12:13 +0530)
commitbe7777d2a9d8d70c931e80868f4f7e373f3f98f8
treeb422514192d50200c43304d9688e51ba471b2322
parente6036a5c7debef92ab1fe02f2a9d7f18463913d8
Harden the rules for GTM control file structure

We introduced GTM control file version in commit d372df43649, way back in
2016-03-02. But in order to support the older version, we were accepting any
bad input and overwriting the control file with initial data. This can lead to
many issues. Hence stop accepting bad version or bad contents. This should
hopefully be not a problem since we're working on a new XL 10 release. And even
if we backpatch this to XL 9.5, it shouldn't cause too much problem as the
version change was introduced before XL 9.5 GA.

We need to work on this more by adding even more stricter checks for control
file sanity, including CRC checksums. But that can happen via a separate
commit.
src/bin/initgtm/initgtm.c
src/bin/pgxc_ctl/gtm_cmd.c
src/gtm/main/main.c