Crash on pg_ctl initdb without options

Поиск
Список
Период
Сортировка
Искать

Crash on pg_ctl initdb without options

От:
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
Дата:
pg_ctl initdb crashes if no options are passed.
Do we need additional if-null test for pgdata_opt just like post_opts?
   $ pg_ctl initdb   sh: -c: line 0: syntax error near unexpected token `null'   sh: -c: line 0: `"/usr/local/pgsql/bin/initdb" (null)'   pg_ctl: database system initialization failed


Index: src/bin/pg_ctl/pg_ctl.c
===================================================================
--- src/bin/pg_ctl/pg_ctl.c	(head)
+++ src/bin/pg_ctl/pg_ctl.c	(fix)
@@ -656,6 +656,9 @@	if (exec_path == NULL)		exec_path = find_other_exec_or_die(argv0, "initdb", "initdb (PostgreSQL) " PG_VERSION "\n");
+	if (pgdata_opt == NULL)
+		pgdata_opt = "";
+	if (post_opts == NULL)		post_opts = "";

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center


Re: Crash on pg_ctl initdb without options

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
On mån, 2009-12-14 at 17:25 +0900, Takahiro Itagaki wrote:
> pg_ctl initdb crashes if no options are passed.
> Do we need additional if-null test for pgdata_opt just like post_opts?
> 
>     $ pg_ctl initdb
>     sh: -c: line 0: syntax error near unexpected token `null'
>     sh: -c: line 0: `"/usr/local/pgsql/bin/initdb" (null)'
>     pg_ctl: database system initialization failed

Oops.  Please fix it. :)



FAQ