Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UZmTu-00020W-9b for pgsql-bugs@arkaria.postgresql.org; Tue, 07 May 2013 18:19:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UZmTt-000337-LU for pgsql-bugs@arkaria.postgresql.org; Tue, 07 May 2013 18:19:17 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UZmTs-000331-Mu for pgsql-bugs@postgresql.org; Tue, 07 May 2013 18:19:16 +0000 Received: from smtprelay0176.b.hostedemail.com ([64.98.42.176] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UZmTp-0000wR-H3 for pgsql-bugs@postgresql.org; Tue, 07 May 2013 18:19:15 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay04.b.hostedemail.com (Postfix) with ESMTP id B69FB7B852; Tue, 7 May 2013 18:19:12 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Panda: scanned! X-HE-Tag: art95_6cb38fcf50810 X-Filterd-Recvd-Size: 1893 Received: from eldon.alvh.no-ip.org (unknown [190.217.218.188]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf05.b.hostedemail.com (Postfix) with ESMTPA; Tue, 7 May 2013 18:19:06 +0000 (UTC) Received: by eldon.alvh.no-ip.org (Postfix, from userid 1000) id 22E341F83; Tue, 7 May 2013 14:19:05 -0400 (CLT) Date: Tue, 7 May 2013 14:19:05 -0400 From: Alvaro Herrera To: Tom Lane Cc: nicolas@marchildon.net, pgsql-bugs@postgresql.org Subject: Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Message-ID: <20130507181904.GA26800@eldon.alvh.no-ip.org> References: <296.1367950228@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <296.1367950228@sss.pgh.pa.us> User-Agent: Mutt/1.5.20 (2009-06-14) Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) 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 Tom Lane wrote: > nicolas@marchildon.net writes: > > The man page says: >=20 > > RETURN VALUE > > The getpwnam() and getpwuid() functions return a pointer to a > > passwd > > structure, or NULL if the matching entry is not found or an= =20 > > error > > occurs. If an error occurs, errno is set appropriately. If one > > wants > > to check errno after the call, it should be set to zero befo= re=20 > > the > > call. >=20 > AFAICS, getpwuid is not honoring its specification here: it failed to > set errno. I don't see that suppressing the strerror result would add > anything much. Well, in this case no error occured, but no matching entry was found. The wording in the manpage is explicit that there not being an entry is not an error. --=20 =C1lvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs