Re: Forbid use of LF and CR characters in database and role names

From: "Ideriha, Takeshi" <ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Forbid use of LF and CR characters in database and role names
Date: 2016-11-25 07:02:38
Message-ID: 4E72940DA2BF16479384A86D54D0988A4D820941@G01JPEXMBKW04
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > [Summary]
> > 1. apply patch and make world
> > -> failed because </para> was mistakenly coded <para>.
> >
> > 2.correct this mistake and make check-world
> > -> got 1 failed test: "'pg_dumpall with \n\r in database name'"
> > because test script cannot createdb "foo\n\rbar"
>
> The attached version addresses those problems. I have replaced the test in
> src/bin/pg_dump/t/ by tests in src/bin/scripts/t/ to check if the role name
> and database name with CR or LF fail to be created. I have as well added a test
> for initdb when the data directory has an incorrect character in 0002.

Thanks for your modification.
I applied your fixed patch and new one, and confirmed the applied source passed the tests successfully. And I also checked manually the error messages were emitted successfully when cr/lf are included in dbname or rolename or data_directory.

AFAICT, this patch satisfies the concept discussed before. So I’ve switched this patch “Ready for Committer”.

Regards,
Ideriha, Takeshi

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2016-11-25 07:40:07 confusing checkpoint_flush_after / bgwriter_flush_after
Previous Message Pavel Stehule 2016-11-25 06:46:09 Re: patch: function xmltable