postgresql/src/bin/initdb
Tom Lane 37f6fd1eaa 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.
2016-08-30 15:25:01 -04:00
..
po Translation updates 2016-08-08 11:08:00 -04:00
t Fix typo in TAP test identification string. 2016-05-23 20:04:27 -04:00
.gitignore Add TAP tests for client programs 2014-04-14 21:33:46 -04:00
Makefile initdb now needs submake-libpq and submake-libpgfeutils. 2016-08-22 08:01:12 -04:00
findtimezone.c Update Windows timezone mapping from Windows 7 and 10 2016-08-18 12:32:42 +02:00
initdb.c Fix initdb misbehavior when user mis-enters superuser password. 2016-08-30 15:25:01 -04:00
nls.mk Translation updates 2016-05-09 10:04:41 -04:00