pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix initdb misbehavior when user mis-enters superuser password.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix initdb misbehavior when user mis-enters superuser password.
@ 2016-08-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-08-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix initdb misbehavior when user mis-enters superuser password.

While testing simple_prompt() revisions, I happened to notice that
current initdb behaves rather badly when --pwprompt is specified and
the user miskeys the second password.  It complains about the mismatch,
does "rm -rf" on the data directory, and exits.  The problem is that
since commit c4a8812cf, there's a standalone backend sitting waiting
for commands at that point.  It gets unhappy about its datadir having
gone away, and spews a PANIC message at the user, which is not nice.
(And the shell then adds to the mess with meaningless bleating about a
core dump...)  We don't really want that sort of thing to happen unless
there's an internal failure in initdb, which this surely is not.

The best fix seems to be to move the collection of the password
earlier, so that it's done essentially as part of argument collection,
rather than at the rather ad-hoc time it was done before.

Back-patch to 9.6 where the problem was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/37f6fd1eaab698983ca1fb2a036d52381347ac71

Modified Files
--------------
src/bin/initdb/initdb.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix initdb misbehavior when user mis-enters superuser password.
@ 2016-08-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-08-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix initdb misbehavior when user mis-enters superuser password.

While testing simple_prompt() revisions, I happened to notice that
current initdb behaves rather badly when --pwprompt is specified and
the user miskeys the second password.  It complains about the mismatch,
does "rm -rf" on the data directory, and exits.  The problem is that
since commit c4a8812cf, there's a standalone backend sitting waiting
for commands at that point.  It gets unhappy about its datadir having
gone away, and spews a PANIC message at the user, which is not nice.
(And the shell then adds to the mess with meaningless bleating about a
core dump...)  We don't really want that sort of thing to happen unless
there's an internal failure in initdb, which this surely is not.

The best fix seems to be to move the collection of the password
earlier, so that it's done essentially as part of argument collection,
rather than at the rather ad-hoc time it was done before.

Back-patch to 9.6 where the problem was introduced.

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/d9720e4377911d9d4157221ff362226f2169fe4c

Modified Files
--------------
src/bin/initdb/initdb.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-08-30 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30 19:25 pgsql: Fix initdb misbehavior when user mis-enters superuser password. Tom Lane <tgl@sss.pgh.pa.us>
2016-08-30 19:25 pgsql: Fix initdb misbehavior when user mis-enters superuser password. Tom Lane <tgl@sss.pgh.pa.us>

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