pgsql: Use pg_parse_lsn() to parse LSN fields in backup_label

Поиск
Список
Период
Сортировка
Искать

pgsql: Use pg_parse_lsn() to parse LSN fields in backup_label

От:
Fujii Masao <fujii@postgresql.org>
Дата:
Use pg_parse_lsn() to parse LSN fields in backup_label

The START WAL LOCATION and CHECKPOINT LOCATION fields in backup_label
accepted overlong high components, which could overflow and produce a
different LSN from the one supplied.

Use pg_parse_lsn() to validate and convert these fields, requiring one
to eight hexadecimal digits per component and no trailing characters,
as for pg_lsn input.

Also detect INCREMENTAL FROM LSN without parsing its value, so that
malformed values such as "junk" do not bypass the existing check
against using an incremental backup directly as a data directory.

Author: Hayato Kuroda 
Reviewed-by: Jan Nidzwetzki 
Reviewed-by: Fujii Masao 
Discussion: https://postgr.es/m/OS7PR01MB18317EED85B1A72C69B226630F5672@OS7PR01MB18317.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/76a55702d89ba9f5d0198c2d5d3d2d62357a8880

Modified Files
--------------
src/backend/access/transam/xlogrecovery.c | 27 ++++++++++++++++++---------
src/backend/utils/adt/pg_lsn.c            |  2 --
src/include/common/pg_parse_lsn.h         |  2 ++
3 files changed, 20 insertions(+), 11 deletions(-)

FAQ