Re: PostgreSQL pollutes the file system

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: Chris Travers <chris(dot)travers(at)adjust(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, euler(at)timbira(dot)com(dot)br, rjuju123(at)gmail(dot)com, "Fred (dot)Flintstone" <eldmannen(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL pollutes the file system
Date: 2019-03-21 14:02:40
Message-ID: 10036.1553176960@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-pkg-debian

Andreas Karlsson <andreas(at)proxel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Imai Yoshikazu 2019-03-21 14:10:59 Re: speeding up planning with partitions
Previous Message Prajwal A V 2019-03-21 14:02:30 Re: Contribution to Perldoc for TestLib module in Postgres

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message Michael Paquier 2019-03-22 00:36:11 Re: PostgreSQL pollutes the file system
Previous Message Andreas Karlsson 2019-03-21 12:12:23 Re: PostgreSQL pollutes the file system