pgsql: Fix assorted issues in pg_ctl's pgwin32_CommandLine().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix assorted issues in pg_ctl's pgwin32_CommandLine().
Дата
Msg-id E1VmXaN-0006nb-E5@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix assorted issues in pg_ctl's pgwin32_CommandLine().

Ensure that the invocation command for postgres or pg_ctl runservice
double-quotes the executable's pathname; failure to do this leads to
trouble when the path contains spaces.

Also, ensure that the path ends in ".exe" in both cases and uses
backslashes rather than slashes as directory separators.  The latter issue
is reported to confuse some third-party tools such as Symantec Backup Exec.

Also, rewrite the function to avoid buffer overrun issues by using a
PQExpBuffer instead of a fixed-size static buffer.  Combinations of
very long executable pathnames and very long data directory pathnames
could have caused trouble before, for example.

Back-patch to all active branches, since this code has been like this
for a long while.

Naoya Anzai and Tom Lane, reviewed by Rajeev Rastogi

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/79193c75f8c78ff494f32cd7b7ee79d7166c225b

Modified Files
--------------
src/bin/pg_ctl/pg_ctl.c |   74 ++++++++++++++++++++++++-----------------------
1 file changed, 38 insertions(+), 36 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix assorted issues in pg_ctl's pgwin32_CommandLine().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix assorted issues in pg_ctl's pgwin32_CommandLine().