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-22 08:55:42
Message-ID: 4E72940DA2BF16479384A86D54D0988A4D81FD09@G01JPEXMBKW04
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Here's a summary for what I tested in RHEL7.0, details follow.

[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"

Details follows:
[1. apply patch and make world>]

I tried to make world after applying patch and there seems to be one small mistake in create_role.
===============================================================

openjade:ref/create_role.sgml:413:7:E: document type does not allow element "PARA" here; missing one of "FOOTNOTE", "ITEMIZEDLIST", "ORDEREDLIST", "VARIABLELIST", "CAUTION", "IMPORTANT", "NOTE", "TIP", "WARNING", "BLOCKQUOTE", "INFORMALEXAMPLE" start-tag
openjade:ref/create_role.sgml:414:11:E: end tag for "PARA" omitted, but OMITTAG NO was specified
openjade:ref/create_role.sgml:413:2: start tag was here
openjade:ref/create_role.sgml:414:11:E: end tag for "PARA" omitted, but OMITTAG NO was specified
openjade:ref/create_role.sgml:408:2: start tag was here
make[3]: *** [HTML.index] Error 1
make[3]: *** Deleting file `HTML.index'

===============================================================

[2.correct this mistake and make check-world]
After fixing this mistake locally by correcting <para> to end tag, postgresql and documentation were successfully made.
And also "make check" tests passed (not "make check-world").

================================================================
diff --git a/doc/src/sgml/ref/create_role.sgml b/doc/src/sgml/ref/create_role.sgml
index 9d6926e..ff4b6f6 100644
--- a/doc/src/sgml/ref/create_role.sgml
+++ b/doc/src/sgml/ref/create_role.sgml
@@ -410,7 +410,7 @@ CREATE ROLE <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replac
as those could be at the origin of security breaches, particularly on
Windows where the command shell is unusable with arguments containing
such characters.
- <para>
+ </para>
</refsect1>

<refsect1>
=================================================================

This failure seems actually caused by t/010_dump_connstr.pl line 65
"$node->run_log(['createdb', "foo\n\rbar"]);".

This means your patch works well.

Excerpt from log follows.
===============================================================
# Failed test 'pg_dumpall with \n\r in database name'
# at /home/ideriha/postgres-master/src/bin/pg_dump/../../../src/test/perl/TestLib.pm line 230.
# Looks like you failed 1 test of 14.
t/010_dump_connstr.pl ..

not ok 6 - pg_dumpall with \n\r in database name

Failed 1/14 subtests

Test Summary Report
-------------------
t/010_dump_connstr.pl (Wstat: 256 Tests: 14 Failed: 1)
Failed test: 6
Non-zero exit status: 1
Files=3, Tests=1822, 58 wallclock secs ( 0.20 usr 0.01 sys + 12.52 cusr 1.94 csys = 14.67 CPU)
Result: FAIL
=================================================================

Regards,
Ideriha, Takeshi
Fujitsu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-11-22 09:15:38 Re: Declarative partitioning - another take
Previous Message Okano, Naoki 2016-11-22 08:52:48 Re: pg_recvlogical --endpos