Re: Add --{no-,}bypassrls flags to createuser

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com, nathandbossart(at)gmail(dot)com, przemyslaw(at)sztoch(dot)pl, david(dot)g(dot)johnston(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, daniel(at)yesql(dot)se, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add --{no-,}bypassrls flags to createuser
Date: 2022-07-13 03:25:18
Message-ID: Ys47HiYLRj2XdBTq@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 26, 2022 at 04:47:46PM +0900, Kyotaro Horiguchi wrote:
> FWIW, the "fancy" here causes me to think about something likely to
> cause syntax breakage of the query to be sent.
>
> createuser -a 'user"1' -a 'user"2' 'user"3'
> createuser -v "2023-1-1'; DROP TABLE public.x; select '" hoge

That would be mostly using spaces here, to make sure that quoting is
correctly applied.

> BUT, thses should be prevented by the functions enumerated above. So,
> I don't think we need them.

Mostly. For example, the test for --valid-until can use a timestamp
with spaces to validate the use of appendStringLiteralConn(). A
second thing is that --member was checked, but not --admin, so I have
renamed regress_user2 to "regress user2" for that to apply a maximum
of coverage, and applied the patch.

One thing that I found annoying is that this made the list of options
of createuser much harder to follow. That's not something caused by
this patch as many options have accumulated across the years and there
is a kind pattern where the connection options were listed first, but
I have cleaned up that while on it. A second area where this could be
done is createdb, as it could be easily expanded if the backend query
gains support for more stuff, but that can happen when it makes more
sense.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sandeep Thakkar 2022-07-13 03:30:10 Re: "ERROR: latch already owned" on gharial
Previous Message Amit Langote 2022-07-13 03:08:33 Re: enable/disable broken for statement triggers on partitioned tables