pgsql: Allow DOS-style line endings in ~/.pgpass files.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow DOS-style line endings in ~/.pgpass files.
Date: 2016-11-15 21:17:43
Message-ID: E1c6l6t-00049g-GL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow DOS-style line endings in ~/.pgpass files.

On Windows, libc will mask \r\n line endings for us, since we read the
password file in text mode. But that doesn't happen on Unix. People
who share password files across both systems might have \r\n line endings
in a file they use on Unix, so as a convenience, ignore trailing \r.
Per gripe from Josh Berkus.

In passing, put the existing check for empty line somewhere where it's
actually useful, ie after stripping the newline not before.

Vik Fearing, adjusted a bit by me

Discussion: <0de37763-5843-b2cc-855e-5d0e5df25807(at)agliodbs(dot)com>

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8951f92da48cb2866b9f694e91f57eeaac7489bb

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2016-11-15 21:36:03 pgsql: Reserve zero as an invalid DSM handle.
Previous Message Tom Lane 2016-11-15 20:55:55 pgsql: Account for catalog snapshot in PGXACT->xmin updates.