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

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd
Дата
Msg-id
20131204155257.GD17114@momjian.us
Ответ на
Список
Дерево обсуждения
BUG #8139: initdb: Misleading error message when current user not in /etc/passwd nicolas@marchildon.net
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Alvaro Herrera <alvherre@2ndquadrant.com>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Alvaro Herrera <alvherre@2ndquadrant.com>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Alvaro Herrera <alvherre@2ndquadrant.com>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Christoph Berg <cb@df7cb.de>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Peter Eisentraut <peter_e@gmx.net>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Alvaro Herrera <alvherre@2ndquadrant.com>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Alvaro Herrera <alvherre@2ndquadrant.com>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Peter Eisentraut <peter_e@gmx.net>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Bruce Momjian <bruce@momjian.us>
Re: BUG #8139: initdb: Misleading error message when current user not in /etc/passwd Tom Lane <tgl@sss.pgh.pa.us>
On Tue, May  7, 2013 at 02:19:05PM -0400, Alvaro Herrera wrote:
> Tom Lane wrote:
> > nicolas@marchildon.net writes:
> 
> > > The man page says:
> > 
> > > 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 
> > > 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  before 
> > > the
> > >        call.
> > 
> > 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.

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

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +
В списке pgsql-bugs по дате отправления
От: craig.miles0712@gmail.com
Дата:
От: shaunc@factfiber.com
Дата:
FAQ