Обсуждение: Re: [GENERAL] Hung postmaster (8.3.9)

Поиск
Список
Период
Сортировка

Re: [GENERAL] Hung postmaster (8.3.9)

От
Tom Lane
Дата:
"Ed L." <pgsql@bluepolka.net> writes:
> On Monday 01 March 2010 @ 17:57, Tom Lane wrote:
>> BTW, there seems to be some other contributing factor here
>> besides the weird username, because I don't see any looping
>> when I try CREATE USER "@".  What's your platform exactly,
>> and what type of filesystem is $PGDATA on?

> This is CentOS 5.2, Linux 2.6.18-92.1.22.el5 #1 SMP x86_64
> GNU/Linux.

Ah.  I can reproduce it on my Fedora box.  The infinite loop is because
feof never returns 1 when reading from a directory.  I think this is a
glibc bug and have filed it accordingly:
https://bugzilla.redhat.com/show_bug.cgi?id=569697
but IME the glibc boys can be pretty stubborn about acknowledging that
corner cases in their code are actually bugs.  We shall see.

In the meantime, it seems like we ought to take two defensive steps:
prevent a quoted @ from being considered as an include introducer,
and prevent @ with no additional text from being considered as an
inclusion reference no matter what.  What the current code is doing
is seeing "@" as an include file reference with empty include name,
and by the time canonicalize_file is done with it this ends up as
a reference to the $PGDATA/global directory itself.  Which Fedora
allows us to open and read, but it reads as an infinite sequence
of EOF characters because feof never succeeds.

            regards, tom lane

Re: Hung postmaster (8.3.9)

От
Greg Stark
Дата:
We should probably also check and prohibit including directories as files.

On Tuesday, March 2, 2010, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> In the meantime, it seems like we ought to take two defensive steps:


--
greg