Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, nicolas(at)marchildon(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd
Date: 2013-12-04 19:03:39
Message-ID: 20131204190338.GP5158@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian wrote:
> On Tue, May 7, 2013 at 02:19:05PM -0400, Alvaro Herrera wrote:

> I have developed the attached patch to fix this and another instance I
> saw.

Remember to set errno = 0 before calling the getpw* function; at least
in initdb it would be meaningful. And in the pg_upgrade case, it seems
better to abort the upgrade if this call doesn't work. (Also, there are
other uses of getpwuid/getpwnam elsewhere. Not sure we want to worry
too much about them.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2013-12-04 19:25:38 Re: BUG #8655: pg_restore problems with materialized views
Previous Message Bruce Momjian 2013-12-04 15:52:57 Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd