Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6Nal-00063B-J4 for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Nov 2016 20:10:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c6Nal-0007zF-4M for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Nov 2016 20:10:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c6Nak-0007z9-QQ for pgsql-bugs@postgresql.org; Mon, 14 Nov 2016 20:10:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c6Nah-0005G7-MM for pgsql-bugs@postgresql.org; Mon, 14 Nov 2016 20:10:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uAEKAnmO030514; Mon, 14 Nov 2016 15:10:49 -0500 From: Tom Lane To: Vik Fearing cc: Josh Berkus , pgsql-bugs Subject: Re: DOS-style line endings in .pgpass 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> Comments: In-reply-to Vik Fearing message dated "Mon, 14 Nov 2016 20:48:37 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30512.1479154249.1@sss.pgh.pa.us> Date: Mon, 14 Nov 2016 15:10:49 -0500 Message-ID: <30513.1479154249@sss.pgh.pa.us> X-Pg-Spam-Score: -4.7 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Vik Fearing 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