postgresql/src/backend
Tom Lane b654714f9b Fix failures to ignore \r when reading Windows-style newlines.
libpq failed to ignore Windows-style newlines in connection service files.
This normally wasn't a problem on Windows itself, because fgets() would
convert \r\n to just \n.  But if libpq were running inside a program that
changes the default fopen mode to binary, it would see the \r's and think
they were data.  In any case, it's project policy to ignore \r in text
files unconditionally, because people sometimes try to use files with
DOS-style newlines on Unix machines, where the C library won't hide that
from us.

Hence, adjust parseServiceFile() to ignore \r as well as \n at the end of
the line.  In HEAD, go a little further and make it ignore all trailing
whitespace, to match what it's always done with leading whitespace.

In HEAD, also run around and fix up everyplace where we have
newline-chomping code to make all those places look consistent and
uniformly drop \r.  It is not clear whether any of those changes are
fixing live bugs.  Most of the non-cosmetic changes are in places that
are reading popen output, and the jury is still out as to whether popen
on Windows can return \r\n.  (The Windows-specific code in pipe_read_line
seems to think so, but our lack of support for this elsewhere suggests
maybe it's not a problem in practice.)  Hence, I desisted from applying
those changes to back branches, except in run_ssl_passphrase_command()
which is new enough and little-tested enough that we'd probably not have
heard about any problems there.

Tom Lane and Michael Paquier, per bug #15827 from Jorge Gustavo Rocha.
Back-patch the parseServiceFile() change to all supported branches,
and the run_ssl_passphrase_command() change to v11 where that was added.

Discussion: https://postgr.es/m/15827-e6ba53a3a7ed543c@postgresql.org
2019-07-25 12:11:17 -04:00
..
access Use full 64-bit XID for checking if a deleted GiST page is old enough. 2019-07-24 20:24:07 +03:00
bootstrap Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
catalog Install dependencies to prevent dropping partition key columns. 2019-07-22 14:55:40 -04:00
commands Check that partitions are not in use when dropping constraints 2019-07-23 17:22:15 -04:00
executor Fix system column accesses in ON CONFLICT ... RETURNING. 2019-07-24 18:45:58 -07:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
lib Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
libpq Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:17 -04:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Speed up finding EquivalenceClasses for a given set of rels 2019-07-21 17:30:58 +12:00
optimizer Adjust overly strict Assert 2019-07-22 10:29:41 +12:00
parser Make identity sequence management more robust 2019-07-22 12:07:10 +02:00
partitioning Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
po Translation updates 2019-06-17 15:30:20 +02:00
port Fix inconsistencies and typos in the tree 2019-07-22 10:01:50 +09:00
postmaster Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Redesign the API for list sorting (list_qsort becomes list_sort). 2019-07-16 11:51:44 -04:00
rewrite Make identity sequence management more robust 2019-07-22 12:07:10 +02:00
snowball Sync our Snowball stemmer dictionaries with current upstream 2019-07-04 13:26:48 +02:00
statistics Use column collation for extended statistics 2019-07-20 16:37:37 +02:00
storage Use appendBinaryStringInfo in more places where the length is known 2019-07-23 00:14:11 +12:00
tcop Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Use full 64-bit XID for checking if a deleted GiST page is old enough. 2019-07-24 20:24:07 +03:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00