Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2Hw3-0001nb-57 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Sep 2018 15:29:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g2Hw1-0005RN-4V for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Sep 2018 15:29:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2Hw0-0005RG-Q1 for pgsql-hackers@lists.postgresql.org; Tue, 18 Sep 2018 15:29:04 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g2Hvx-0004zw-K5 for pgsql-hackers@lists.postgresql.org; Tue, 18 Sep 2018 15:29:03 +0000 Received: from smtp2.mailbox.org (unknown [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 7BB47493C1; Tue, 18 Sep 2018 17:28:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id O33C9w_VxzE2; Tue, 18 Sep 2018 17:28:54 +0200 (CEST) Message-ID: <71bf47219037a5e3839748eb55e4fa175b58f523.camel@cybertec.at> Subject: Re: pgsql: Allow concurrent-safe open() and fopen() in frontend code for Wi From: Laurenz Albe To: Tom Lane , Michael Paquier Cc: pgsql-hackers@lists.postgresql.org Date: Tue, 18 Sep 2018 17:28:53 +0200 In-Reply-To: <23296.1537281909@sss.pgh.pa.us> References: <23543.1536938575@sss.pgh.pa.us> <20180914224939.GA1178@paquier.xyz> <20180917114113.GA31460@paquier.xyz> <17194.1537191697@sss.pgh.pa.us> <20180917140202.GF31460@paquier.xyz> <19655.1537195712@sss.pgh.pa.us> <3883.1537200836@sss.pgh.pa.us> <11148.1537227504@sss.pgh.pa.us> <20180918001143.GG31460@paquier.xyz> <20180918024227.GI31460@paquier.xyz> <23296.1537281909@sss.pgh.pa.us> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane wrote: > Well, we have to do something. I have a report from EDB's packagers > that in 11beta4, "initdb --pwfile" is failing on Windows (ie, one can't > connect afterwards using the specified password). It seems nearly > certain to me that the reason is that the file is read with > > FILE *pwf = fopen(pwfilename, "r"); > > and so the \r isn't getting stripped from what's used as the password. Perhaps there is something obvious that I'm missing, but it seems that all the problems we observe are caused by frontend code suddenly defaulting to binary mode when it was text mode before. Would it be an option to have pgwin32_open default to text mode in frontend code and to binary mode in backend code? Yours, Laurenz Albe