postgresql/src/common
Tom Lane 1d96c1b91a Fix incorrect ordering of operations in pg_resetwal and pg_rewind.
Commit c37b3d08c dropped its added GetDataDirectoryCreatePerm call into
the wrong place in pg_resetwal.c, namely after the chdir to DataDir.
That broke invocations using a relative path, as reported by Tushar Ahuja.
We could have left it where it was and changed the argument to be ".",
but that'd result in a rather confusing error message in event of a
failure, so re-ordering seems like a better solution.

Similarly reorder operations in pg_rewind.c.  The issue there is that
it doesn't seem like a good idea to do any actual operations before the
not-root check (on Unix) or the restricted token acquisition (on Windows).
I don't know that this is an actual bug, but I'm definitely not convinced
that it isn't, either.

Assorted other code review for c37b3d08c and da9b580d8: fix some
misspelled or otherwise badly worded comments, put the #include for
<sys/stat.h> where it actually belongs, etc.

Discussion: https://postgr.es/m/aeb9c3a7-3c3f-a57f-1a18-c8d4fcdc2a1f@enterprisedb.com
2018-05-23 10:59:55 -04:00
..
unicode Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
base64.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
config_info.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
controldata_utils.c Fix error message on short read of pg_control 2018-05-18 17:54:18 +02:00
exec.c Enlarge find_other_exec's meager fgets buffer 2018-04-19 10:45:15 -03:00
fe_memutils.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
file_perm.c Fix incorrect ordering of operations in pg_resetwal and pg_rewind. 2018-05-23 10:59:55 -04:00
file_utils.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
ip.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
keywords.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
md5.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_lzcompress.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgfnames.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
psprintf.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
relpath.c Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
restricted_token.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
rmtree.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
saslprep.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
scram-common.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sha2.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sha2_openssl.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
string.c restrict -> pg_restrict 2018-03-15 10:02:59 -03:00
unicode_norm.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
username.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
wait_error.c Update copyright for 2018 2018-01-02 23:30:12 -05:00