pgsql: Add a new GUC parameter backslash_quote, which determines whether

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Add a new GUC parameter backslash_quote, which determines whether
Дата
Msg-id 20060521201042.BF2569FA19B@postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Add a new GUC parameter backslash_quote, which determines whether the SQL
parser will allow "\'" to be used to represent a literal quote mark.  The
"\'" representation has been deprecated for some time in favor of the
SQL-standard representation "''" (two single quote marks), but it has been
used often enough that just disallowing it immediately won't do.  Hence
backslash_quote allows the settings "on", "off", and "safe_encoding",
the last meaning to allow "\'" only if client_encoding is a valid server
encoding.  That is now the default, and the reason is that in encodings
such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a
multibyte character, accepting "\'" allows SQL-injection attacks as per
CVE-2006-2314 (further details will be published after release).  The
"on" setting is available for backward compatibility, but it must not be
used with clients that are exposed to untrusted input.

Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        config.sgml (r1.58 -> r1.59)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/config.sgml.diff?r1=1.58&r2=1.59)
    pgsql/src/backend/parser:
        scan.l (r1.134 -> r1.135)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/scan.l.diff?r1=1.134&r2=1.135)
    pgsql/src/backend/utils/misc:
        guc.c (r1.319 -> r1.320)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c.diff?r1=1.319&r2=1.320)
        postgresql.conf.sample (r1.176 -> r1.177)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/postgresql.conf.sample.diff?r1=1.176&r2=1.177)
    pgsql/src/include/parser:
        gramparse.h (r1.35 -> r1.36)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/gramparse.h.diff?r1=1.35&r2=1.36)

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Change the backend to reject strings containing invalidly-encoded
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Add a new GUC parameter backslash_quote, which determines whether