aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-08-16 15:44:03 +0000
committerBruce Momjian <bruce@momjian.us>2004-08-16 15:44:03 +0000
commit33829a5e0f3eb6f9ae80728e1aa78fc208a5daae (patch)
tree207758009f0a76c2838197131b728fea352c8f14 /src
parentfa82574bc50c9501f8e5de79d00b5330dc592046 (diff)
downloadpostgresql-33829a5e0f3eb6f9ae80728e1aa78fc208a5daae.tar.gz
postgresql-33829a5e0f3eb6f9ae80728e1aa78fc208a5daae.zip
Throw error if initdb -L is not an absolute path.
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 0b4ccbc229e..953a5ceba31 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.49 2004/08/11 23:28:54 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.50 2004/08/16 15:44:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2234,7 +2234,12 @@ main(int argc, char *argv[])
share_path = xmalloc(MAXPGPATH);
get_share_path(backend_exec, share_path);
}
-
+ else if (!is_absolute_path(share_path))
+ {
+ fprintf(stderr, _("%s: input file location must be an absolute path\n"), progname);
+ exit(1);
+ }
+
canonicalize_path(share_path);
if ((short_version = get_short_version()) == NULL)