Re: DOS-style line endings in .pgpass

From: Vik Fearing <vik(at)2ndquadrant(dot)fr>
To: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: DOS-style line endings in .pgpass
Date: 2016-11-14 19:48:37
Message-ID: 17d357ef-1a01-2493-a8b0-733010bf4bf0@2ndquadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 11/14/2016 08:31 PM, Josh Berkus wrote:
> Version Tested: 9.6.1
> Platform: Fedora 24 Docker Base Image
> Summary: DOS-style line endings (CRLF) cause .pgpass to fail.
>
> Steps to Reproduce:
>
> 1. Install PostgreSQL
> 2. Set up user with md5 passwords
> 3. Create pgpass file using program which makes CRLF line endings, such
> as Python's CSV module, or windows Notepad.
> 4. Try to log in
> 5. Get:
>
> psql: FATAL: password authentication failed for user "postgres"
> password retrieved from file "/var/lib/pgsql/.pgpass"
>
> What appears to be happening here is that one of the characters of the
> CRLF is being appended to the password, making it invalid.
>
> Is this a known issue on Windows? Or is this peculiar to Fedora?
>
> If it's a general issue, it would be friendly to Windows devs to fix it.

Maybe something like the attached patch?
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

Attachment Content-Type Size
pgpass_crlf.patch invalid/octet-stream 675 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John McKown 2016-11-14 20:01:29 Re: DOS-style line endings in .pgpass
Previous Message Josh Berkus 2016-11-14 19:31:22 DOS-style line endings in .pgpass