pg.ddx.io  pgsql-pkg-debian@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Karlsson <andreas@proxel.se>
Cc: Chris Travers <chris.travers@adjust.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Tatsuo Ishii <ishii@sraoss.co.jp>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: euler@timbira.com.br, rjuju123@gmail.com, "Fred .Flintstone" <eldmannen@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: PostgreSQL pollutes the file system
Date: Thu, 21 Mar 2019 10:02:40 -0400
Message-ID: <10036.1553176960@sss.pgh.pa.us> (raw)
In-Reply-To: <fdbcadf7-9edd-b20d-9987-4e7d21d23b2d@proxel.se>
References: <20190320180832.GA11614@alvherre.pgsql>
	<754d8607-682e-6f59-6870-faee5fa0820c@2ndquadrant.com>
	<20190321.084132.2186284141219540889.t-ishii@sraoss.co.jp>
	<20190321004919.GE20192@paquier.xyz>
	<CAN-RpxBfajcAmdP_ghBjXgGYq1f+vf_Em+P6LBqfCq=av2cumg@mail.gmail.com>
	<fdbcadf7-9edd-b20d-9987-4e7d21d23b2d@proxel.se>

Andreas Karlsson <andreas@proxel.se> writes:
> On 3/21/19 7:07 AM, Chris Travers wrote:
>> 1.  createuser/dropuser are things that I don't consider good ways of 
>> creating users anyway.

> Those binaries are pretty convenient to use in scripts since they handle 
> SQL escaping for you, but probably not convenient enough that we would 
> have added createuser today.

> Compare
> createuser "$USER"
> vs
> echo 'CREATE ROLE :"user" LOGIN' | psql postgres -v "user=$USER"

Hmm.  That example is actually quite scary, because while nearly
anybody who's ever done any shell scripting would get the first
one right, the second one requires a fair deal of specialized
knowledge and creativity.  I fear that 99% of people would have
coded it like

	echo "CREATE USER $USER" | psql

or some variant on that, and now they have a SQL-injection
hazard that they didn't have before.

So there seems like a real risk that taking away createuser would
result in security holes, not just annoying-but-trivial script update
work.  That puts me more in the camp of "if we're going to do anything,
rename it with a pg_ prefix" than "if we're going to do anything,
remove it".

			regards, tom lane




view thread (113+ messages)  latest in thread

Message-ID: <10036.1553176960@sss.pgh.pa.us>
Permalink:  ../10036.1553176960@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10036.1553176960@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-pkg-debian@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andreas@proxel.se, chris.travers@adjust.com, michael@paquier.xyz, ishii@sraoss.co.jp, tomas.vondra@2ndquadrant.com, alvherre@2ndquadrant.com, eldmannen@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: PostgreSQL pollutes the file system
  In-Reply-To: <10036.1553176960@sss.pgh.pa.us>
  References: <20190320180832.GA11614@alvherre.pgsql> <754d8607-682e-6f59-6870-faee5fa0820c@2ndquadrant.com> <20190321.084132.2186284141219540889.t-ishii@sraoss.co.jp> <20190321004919.GE20192@paquier.xyz> <CAN-RpxBfajcAmdP_ghBjXgGYq1f+vf_Em+P6LBqfCq=av2cumg@mail.gmail.com> <fdbcadf7-9edd-b20d-9987-4e7d21d23b2d@proxel.se> <10036.1553176960@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox