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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, nicolas(at)marchildon(dot)net, Bugs for PostgreSQL <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd
Date: 2013-12-10 00:47:34
Message-ID: 20131210004734.GE2119@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Dec 9, 2013 at 06:45:39PM -0300, Alvaro Herrera wrote:
> Bruce Momjian wrote:
>
> > return STATUS_ERROR;
> > }
> >
> > ! user_name = get_user_name(&errstr);
> > ! if (!user_name)
> > {
> > ! ereport(LOG, (errmsg("%s\n", errstr)));
> > ! pfree(errstr);
> > return STATUS_ERROR;
> > }
>
> The message is already translated by get_user_name, so I think this
> should use errmsg_internal() instead of errmsg(). Also, why do you add
> a newline?

OK, done.

> Not clear whether the new file should be in src/port or src/common.

Agreed. It isn't designed to add missing OS functionality, but it is
mostly OS-specific code.

Updated patch attached, with Tom's requested changes.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
passwd.diff text/x-diff 18.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2013-12-10 01:00:54 Re: BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby
Previous Message Bruce Momjian 2013-12-10 00:46:30 Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd