Skip to content

Commit 33829a5

Browse files
committed
Throw error if initdb -L is not an absolute path.
1 parent fa82574 commit 33829a5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/initdb/initdb.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.49 2004/08/11 23:28:54 tgl Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.50 2004/08/16 15:44:03 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -2234,7 +2234,12 @@ main(int argc, char *argv[])
22342234
share_path = xmalloc(MAXPGPATH);
22352235
get_share_path(backend_exec, share_path);
22362236
}
2237-
2237+
else if (!is_absolute_path(share_path))
2238+
{
2239+
fprintf(stderr, _("%s: input file location must be an absolute path\n"), progname);
2240+
exit(1);
2241+
}
2242+
22382243
canonicalize_path(share_path);
22392244

22402245
if ((short_version = get_short_version()) == NULL)

0 commit comments

Comments
 (0)