Multibyte bug in hba.c regular expression processing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Multibyte bug in hba.c regular expression processing
Дата
Msg-id 11727.1375279116@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
It appears to me that check_ident_usermap() will substitute incorrectly
for \1 if the user name contains any multibyte characters, because
it supposes that the "rm_so" and "rm_eo" numbers returned by pg_regexec()
are byte offsets, when in reality they are character offsets.

Correct code for this would need to use charlen_to_bytelen() to navigate
the string to the proper places, as is done in replace_text_regexp() for
example.

I'm not terribly excited about fixing this myself, but perhaps someone
else would like to.
        regards, tom lane



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Small comment fix in sinvaladt.c
Следующее
От: Tom Lane
Дата:
Сообщение: Re: REGEXP_MATCHES() strange behavior with '^' and '$' pattern