diff options
Diffstat (limited to 'src/test/examples/testlo64.c')
-rw-r--r-- | src/test/examples/testlo64.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/examples/testlo64.c b/src/test/examples/testlo64.c index bb188cc3a18..39ba009c523 100644 --- a/src/test/examples/testlo64.c +++ b/src/test/examples/testlo64.c @@ -256,6 +256,17 @@ main(int argc, char **argv) exit_nicely(conn); } + /* Set always-secure search path, so malicous users can't take control. */ + res = PQexec(conn, + "SELECT pg_catalog.set_config('search_path', '', false)"); + if (PQresultStatus(res) != PGRES_COMMAND_OK) + { + fprintf(stderr, "SET failed: %s", PQerrorMessage(conn)); + PQclear(res); + exit_nicely(conn); + } + PQclear(res); + res = PQexec(conn, "begin"); PQclear(res); printf("importing file \"%s\" ...\n", in_filename); |