pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vik Fearing <vik@2ndquadrant.fr>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: DOS-style line endings in .pgpass
Date: Mon, 14 Nov 2016 15:10:49 -0500
Message-ID: <30513.1479154249@sss.pgh.pa.us> (raw)
In-Reply-To: <17d357ef-1a01-2493-a8b0-733010bf4bf0@2ndquadrant.fr>
References: <0de37763-5843-b2cc-855e-5d0e5df25807@agliodbs.com>
	<17d357ef-1a01-2493-a8b0-733010bf4bf0@2ndquadrant.fr>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Vik Fearing <vik@2ndquadrant.fr> writes:
> On 11/14/2016 08:31 PM, Josh Berkus wrote:
>> What appears to be happening here is that one of the characters of the
>> CRLF is being appended to the password, making it invalid.

> Maybe something like the attached patch?

Our usual approach to \r characters is that they're whitespace.  I wonder
whether the most friendly solution here is to chomp all trailing
whitespace.  Anybody ever heard of using a trailing space or tab in a
password?

	while (len > 0 && strchr(" \t\r\n", buf[len - 1]) != NULL)
		buf[--len] = '\0';

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <30513.1479154249@sss.pgh.pa.us>
Permalink:  ../30513.1479154249@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30513.1479154249@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vik@2ndquadrant.fr, josh@agliodbs.com
  Subject: Re: DOS-style line endings in .pgpass
  In-Reply-To: <30513.1479154249@sss.pgh.pa.us>
  References: <0de37763-5843-b2cc-855e-5d0e5df25807@agliodbs.com> <17d357ef-1a01-2493-a8b0-733010bf4bf0@2ndquadrant.fr> <30513.1479154249@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox