Re: BUG #19730: PostgreSQL `pg_backup_start` accepts newlines in the backup label, producing an unrestorable `backup - Mailing list pgsql-bugs

From shihao zhong
Subject Re: BUG #19730: PostgreSQL `pg_backup_start` accepts newlines in the backup label, producing an unrestorable `backup
Date
Msg-id CAGRkXqS7znpXT6P-iLnTZthnMm1EtUx+N8yZ-WSkU3i38vi1fg@mail.gmail.com
Whole thread
In response to Re: BUG #19730: PostgreSQL `pg_backup_start` accepts newlines in the backup label, producing an unrestorable `backup  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #19730: PostgreSQL `pg_backup_start` accepts newlines in the backup label, producing an unrestorable `backup
List pgsql-bugs
> In short, I'm on board with the addition of an extra check that
> enforces this policy in do_pg_backup_start()
>
> Perhaps we should add one test query somewhere in a TAP script of
> src/test/recovery/, while on it.

Fair enough. Patch attached. It is the check from the report, with
the error wording of b380a56a3f95, and a test next to the "backup
label too long" one in 020_archive_status.pl.

One thing to note. A label that ends with a newline works today, and
this patch rejects it. A script that reads the label from a file can
hit that, so I think this should go to master only.

Thanks,
Shihao
Attachment

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #19730: PostgreSQL `pg_backup_start` accepts newlines in the backup label, producing an unrestorable `backup
Next
From: Michael Paquier
Date:
Subject: Re: BUG #19730: PostgreSQL `pg_backup_start` accepts newlines in the backup label, producing an unrestorable `backup