Abort if dup fail (src/bin/pg_dump/compress_none.c)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Abort if dup fail (src/bin/pg_dump/compress_none.c)
Дата
Msg-id CAEudQAr9fu0W9ULyT_+08v4BAn2bMU=D-VON=OwvciVRy5N_4A@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi.

Per Coverity.
CID 1506240: (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
3. negative_returns: dup(fd) is passed to a parameter that cannot be negative.

pg_dump function open_none, tries to associate a stream to a file descriptor,
using function dup, which may fail and return negative value.

fdopen cannot receive negative parameters, in this case fail and return EBADF.

This can be confusing for the user, who will be trying to figure out what's wrong.
Better abort and report the correct failure to the user.

Patch attached.

Best regards,
Ranier Vilela


Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pgsql: Clean pg_walsummary's tmp_check directory.
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Flushing large data immediately in pqcomm