pgsql: initdb -S should now have an explicit check that $PGDATA is vali

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: initdb -S should now have an explicit check that $PGDATA is vali
Date: 2015-05-29 21:03:04
Message-ID: E1YyRQm-0006FJ-QI@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

initdb -S should now have an explicit check that $PGDATA is valid.

The fsync code from the backend essentially assumes that somebody's already
validated PGDATA, at least to the extent of it being a readable directory.
That's safe enough for initdb's normal code path too, but "initdb -S"
doesn't have any other processing at all that touches the target directory.
To have reasonable error-case behavior, add a pg_check_dir call.
Per gripe from Peter E.

Branch
------
REL9_3_STABLE

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

Modified Files
--------------
src/bin/initdb/initdb.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2015-05-29 21:44:59 pgsql: pg_upgrade: add missing period in C comment
Previous Message Tom Lane 2015-05-29 20:06:06 Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal.