Re: Patch for checking file parameters to psql before password prompt

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: Patch for checking file parameters to psql before password prompt
Дата
Msg-id CAK3UJRHQ3QkjJbNH56kbV71f-kQBCoEJVEu-V6An8RV8nbD5sw@mail.gmail.com
обсуждение исходный текст
Ответ на Patch for checking file parameters to psql before password prompt  (Alastair Turner <bell@ctrlf5.co.za>)
Ответы Re: Patch for checking file parameters to psql before password prompt  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On Sun, Dec 2, 2012 at 4:37 AM, Alastair Turner <bell@ctrlf5.co.za> wrote:
> Patch for the changes discussed in
> http://archives.postgresql.org/pgsql-hackers/2010-10/msg00919.php
> attached (eventually ...)
>
> In summary: If the input file (-f) doesn't exist or the ouput or log
> files (-o and -l) can't be created psql exits before prompting for a
> password.

I assume you meant "-L" instead of "-l" here for specifying psql's log
file. I don't think that the inability to write to psql's log file
should be treated as a fatal error, especially since it is not treated
as such by the current code:
 $ psql test -L /tmp/not_allowed psql: could not open log file "/tmp/not_allowed": Permission denied [... proceeds to
psqlprompt from here ...]
 

and the user (or script) may still usefully perform his work. Whereas
with your patch:
 $ psql test -L /tmp/not_allowed psql: could not open log file "/tmp/not_allowed": Permission denied $

And IMO the same concern applies to the query results file, "-o".
Although +1 for the part about having psql exit early if the input
filename does not exist, since psql already bails out in this case,
and there is nothing else to be done in such case.

Josh



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: PATCH: optimized DROP of multiple tables within a transaction
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Makefiles don't seem to remember to rebuild everything anymore