Re: BUG #2424: initdb Did Not Escape the Password

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2424: initdb Did Not Escape the Password
Дата
Msg-id 23763.1148746586@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #2424: initdb Did Not Escape the Password  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: BUG #2424: initdb Did Not Escape the Password  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Your patch has been added to the PostgreSQL unapplied patches list at:

I don't particularly like this patch, because it is predicated on a
false assumption, namely that initdb uses libpq to talk to the backend.
ISTM PQescapeString is not the thing to use.  (As a concrete example
of why not, there'll be no way to make it use the correct value of
standard_conforming_strings, when that default changes.)

I think the best solution is probably to use the existing escape_quotes
function and to place its output in an E'' string.

I looked through initdb to see if there were any other places where it
was creating SQL string literals that might have escaping problems.
All of the COPY commands it issues are potentially at risk: consider
the possibility that the installation sharedir has a quote or backslash
in its path.  I didn't see any other holes though.

Will fix this later today.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Strange random() Correlation
Следующее
От: Volkan YAZICI
Дата:
Сообщение: Re: Strange random() Correlation