Re: [DOCS] Moving tablespaces

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [DOCS] Moving tablespaces
Дата
Msg-id 21564.1323187676@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [DOCS] Moving tablespaces  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: [DOCS] Moving tablespaces  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> There is some nice precedent in the CREATE TABLESPACE command (though
> dependent on HAVE_SYMLINK and not HAVE_READLINK), so I'm just going to
> copy the error message from there.

Fair enough.

Looking at the existing readlink use in port/exec.c, it strikes me that
another thing you'd better do is include a check for buffer overrun,
ie the test needs to be more like

        rllen = readlink(fname, link_buf, sizeof(link_buf));
        if (rllen < 0 || rllen >= sizeof(link_buf))
            ... fail ...

Also, you're assuming that the result is already null-terminated,
which is incorrect.

            regards, tom lane

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pull_up_simple_subquery
Следующее
От: "Azghar Hussain"
Дата:
Сообщение: Recover data....