| От | Itagaki Takahiro |
|---|---|
| Тема | Re: pg_read_file() and non-ascii input file |
| Дата | |
| Msg-id | 20091130183605.64E5.52131E4D@oss.ntt.co.jp обсуждение |
| Ответ на | pg_read_file() and non-ascii input file (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>) |
| Ответы |
Re: pg_read_file() and non-ascii input file
|
| Список | pgsql-hackers |
Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp> wrote:
> pg_read_file() takes byte-offset and length as arguments,
> but we don't check the result text with pg_verify_mbstr().
> Should pg_read_file() return bytea instead of text or adding
> some codes to verify the input? Only superusers are allowed
> to use the function, but it is still dangerous.
Here is a patch to modify the result type of pg_read_file to bytea.
I think it is a possibly-security hole -- it might be safe because only
supersusers can use the function, but it is still dangerous.
We can still use the function to read a text file:
SELECT convert_from(pg_read_file(...), 'encoding')
If we want to keep backward compatibility, the issue can be fixed
by adding pg_verifymbstr() to the function. We can also have the
binary version in another name, like pg_read_binary_file().
Which solution is better? Comments welcome.
Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера