Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEb1b-0004gP-Ib for pgsql-bugs@postgresql.org; Thu, 20 Sep 2012 07:18:15 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEb1a-0007Rm-5G for pgsql-bugs@postgresql.org; Thu, 20 Sep 2012 07:18:14 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id E426828288; Thu, 20 Sep 2012 00:18:12 -0700 (PDT) Received: from zcs-prod-mta-3.vmware.com (zcs-prod-mta-3.vmware.com [10.113.163.65]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id E0255184AC; Thu, 20 Sep 2012 00:18:12 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-mta-3.vmware.com (Postfix) with ESMTP id 9EBA4E3321; Thu, 20 Sep 2012 00:18:03 -0700 (PDT) X-Virus-Scanned: amavisd-new at zcs-prod-mta-3.vmware.com Received: from zcs-prod-mta-3.vmware.com ([127.0.0.1]) by localhost (zcs-prod-mta-3.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vSxIGW357K66; Thu, 20 Sep 2012 00:18:03 -0700 (PDT) Received: from [10.113.227.81] (unknown [10.113.160.14]) by zcs-prod-mta-3.vmware.com (Postfix) with ESMTPSA id 38832E331F; Thu, 20 Sep 2012 00:18:02 -0700 (PDT) Message-ID: <505AC330.7010102@vmware.com> Date: Thu, 20 Sep 2012 10:18:08 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6 MIME-Version: 1.0 To: Andy Grimm CC: Euler Taveira de Oliveira , PostgreSQL Bugs Subject: Re: BUG #6412: psql & fe-connect truncate passwords References: <4F242892.50403@timbira.com> <4F24437F.7080306@timbira.com> <4F24972F.6080904@timbira.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.4 (-------) X-Archive-Number: 201209/224 X-Sequence-Number: 34218 On 15.02.2012 07:09, Andy Grimm wrote: > Sorry that it's been a couple of weeks, but I have gotten around to > working on a patch that address more of these concerns. The attached > patch should > > 1) allow arbitrary length passwords to be read from a file via initdb --pwfile > 2) allow the client to accept a password of arbitrary length at the > password prompt > 3) allow a password of arbitrary length in a pgpass file > > In #2 I say "allow the client to accept", because there's a > pq_getmessage call in src/backend/libpq/auth.c which limits the > password message length to 1000 characters. Changing that part of the > code should allow longer passwords, but there may be other lurking > backend issues after that, and I'm not concerned about going beyond > 1000 at this point. Thanks for the patch. A few comments: * Most of the simple_prompt() calls are for passwords, which now have no limit, but there's a few others. How about we remove the maxlen argument altogether, and just have it always return a malloc'd string that can be arbitrarily long. (maybe with a sanity-check limit within simple_prompt(), like 100k) * .pg_service.conf handling still has a fixed limit on line length of 256 bytes. See parseServiceInfo() in fe-connect. I think we should lift that limit too, for the sake of consistency. You can pass a password in the service file, too. * Missed a few simple_prompt() calls in contrib (oid2name, vacuumlo, pgbench) - Heikki